-
Notifications
You must be signed in to change notification settings - Fork 1
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
2 changed files
with
48 additions
and
0 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,7 @@ | ||
Dockerfile | ||
.dockerignore | ||
node_modules | ||
npm-debug.log | ||
README.md | ||
.next | ||
.git |
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,41 @@ | ||
FROM node:20-alpine AS deps | ||
|
||
RUN npm install -g pnpm | ||
WORKDIR /app | ||
|
||
COPY package.json pnpm-lock.yaml ./ | ||
|
||
RUN pnpm install --frozen-lockfile | ||
RUN rm -f ~/.npmrc | ||
|
||
FROM node:20-alpine AS builder | ||
|
||
RUN npm install -g pnpm | ||
WORKDIR /app | ||
|
||
COPY --from=deps /app/node_modules ./node_modules | ||
COPY . . | ||
|
||
ARG NODE_ENV | ||
ARG API_URL | ||
ARG SITE_URL | ||
|
||
ENV NODE_ENV=$NODE_ENV | ||
ENV NEXT_PUBLIC_API_URL=$API_URL | ||
ENV SITE_URL=$SITE_URL | ||
|
||
RUN pnpm build | ||
|
||
FROM gcr.io/distroless/nodejs20-debian12 as runner | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /app/public ./public | ||
|
||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./ | ||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static | ||
|
||
EXPOSE 3000 | ||
ENV HOSTNAME "0.0.0.0" | ||
|
||
CMD ["server.js"] |