generated from defi-wonderland/web3-nextjs-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
100 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Ignore all .env files in any directory or subdirectory | ||
**/.env | ||
|
||
# Ignore node_modules and dist directories in any directory or subdirectory | ||
**/node_modules | ||
**/dist | ||
|
||
**/.git | ||
**/*.md | ||
**/cypress | ||
**/.github | ||
.next | ||
!.next/static | ||
!.next/standalone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Use an official Node.js image as a parent image | ||
FROM node:20 AS build | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
RUN corepack enable | ||
|
||
# # Install pnpm globally | ||
# RUN npm install -g pnpm | ||
|
||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy pnpm-lock.yaml and package.json files | ||
COPY package.json pnpm-lock.yaml ./ | ||
|
||
# Install dependencies using pnpm | ||
RUN CI=1 pnpm install --frozen-lockfile | ||
|
||
# Copy the rest of the application code | ||
COPY . . | ||
|
||
# Build the application | ||
RUN pnpm build | ||
|
||
# Use a lighter Node.js image for the final stage | ||
FROM node:20-slim AS ui | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
ENV NODE_ENV=production | ||
RUN corepack enable | ||
|
||
# Set the working directory in the container | ||
WORKDIR /app | ||
|
||
# Copy only necessary files from the build stage | ||
COPY --from=build /app/package.json /app/pnpm-lock.yaml ./ | ||
COPY --from=build /app/public ./public | ||
COPY --from=build /app/.next/standalone ./ | ||
COPY --from=build /app/.next/static ./.next/static | ||
|
||
|
||
# # Install only production dependencies with pnpm | ||
# RUN CI=1 pnpm install --no-frozen-lockfile | ||
|
||
# Expose the port on which the application will run | ||
EXPOSE 5173 | ||
ENV PORT=5173 | ||
|
||
# Specify the command to run the application | ||
CMD ["node", "server.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.