-
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
5 changed files
with
23 additions
and
13 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,2 @@ | ||
.next | ||
node_modules |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
ARG NODE_VERSION=18-slim | ||
ARG NODE_VERSION=18 | ||
|
||
# Build phase | ||
FROM node:$NODE_VERSION AS builder | ||
FROM node:$NODE_VERSION-slim AS builder | ||
WORKDIR /app | ||
|
||
# Prepare node_modules | ||
COPY ./ ./ | ||
RUN npm install -g pnpm | ||
RUN pnpm install --frozen-lockfile | ||
COPY package.json pnpm-lock.yaml ./ | ||
|
||
ENV NODE_ENV=production | ||
RUN pnpm install --frozen-lockfile --production | ||
COPY . . | ||
|
||
RUN ./node_modules/next/dist/bin/next build | ||
|
||
# Run phase | ||
FROM node:$NODE_VERSION AS runner | ||
FROM gcr.io/distroless/nodejs$NODE_VERSION-debian12:latest AS runner | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/xpadev-net/video_host_frontend | ||
LABEL org.opencontainers.image.source=https://github.com/magi-sche-org/frontend | ||
WORKDIR /app | ||
|
||
COPY --from=builder /app ./ | ||
COPY --from=builder /app/.next ./.next | ||
COPY --from=builder /app/public ./public | ||
COPY --from=builder /app/node_modules ./node_modules | ||
COPY --from=builder /app/package.json ./package.json | ||
COPY --from=builder /app/next.config.js ./next.config.js | ||
|
||
# Copy artifacts | ||
CMD ["./start.sh"] | ||
CMD ["./node_modules/next/dist/bin/next", "start", "-p", "3000"] |
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