-
Notifications
You must be signed in to change notification settings - Fork 52
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
7 changed files
with
387 additions
and
298 deletions.
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,16 @@ | ||
.git | ||
.gitignore | ||
*.md | ||
*.log | ||
dist | ||
Dockerfile | ||
.dockerignore | ||
.next | ||
LICENSE | ||
docs | ||
.github | ||
|
||
.husky | ||
node_modules | ||
tests | ||
coverage |
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,35 @@ | ||
# Base image with pnpm pre-installed | ||
FROM node:20-alpine AS base | ||
ENV PNPM_HOME="/pnpm" | ||
ENV PATH="$PNPM_HOME:$PATH" | ||
WORKDIR /app | ||
RUN npm install -g pnpm | ||
|
||
# Production dependencies stage | ||
FROM base AS prod-deps | ||
WORKDIR /app | ||
COPY package.json pnpm-lock.yaml ./ | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile --ignore-scripts | ||
|
||
# Build stage | ||
FROM base AS build | ||
WORKDIR /app | ||
COPY package.json pnpm-lock.yaml ./ | ||
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile | ||
COPY . . | ||
RUN pnpm run build | ||
|
||
# Final image (minimal size) | ||
FROM base AS final | ||
WORKDIR /app | ||
|
||
# Copy only the necessary files from previous stages | ||
COPY --from=prod-deps /app/node_modules ./node_modules | ||
COPY --from=build /app/.next ./.next | ||
COPY package.json pnpm-lock.yaml ./ | ||
COPY public ./public | ||
|
||
EXPOSE 3000 | ||
|
||
# Set the entry point for production | ||
CMD [ "pnpm", "start" ] |
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.