Restore docker deployment pipeline
Adapt the Dockerfile to work with Nuxt and restore the deployment pipeline.
This commit is contained in:
parent
d8a31db44d
commit
754d175ce2
4 changed files with 41 additions and 51 deletions
37
Dockerfile
Normal file
37
Dockerfile
Normal file
|
@ -0,0 +1,37 @@
|
|||
# syntax=docker.io/docker/dockerfile:1
|
||||
# Based on Next.js's docker image example
|
||||
FROM node:22 AS base
|
||||
|
||||
# Install dependencies only when needed
|
||||
FROM base AS deps
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json pnpm-lock.yaml* ./
|
||||
RUN corepack enable pnpm && pnpm i --frozen-lockfile
|
||||
|
||||
# Rebuild the source code only when needed
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
RUN corepack enable pnpm && pnpm run build
|
||||
|
||||
# Production image, copy all the files and run next
|
||||
FROM base AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
COPY --from=builder /app/.output ./
|
||||
COPY --chown=node:node schedule.json .
|
||||
RUN echo '[]' > push-subscriptions.json && chown node:node push-subscriptions.json
|
||||
|
||||
USER node
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
ENV PORT=3000
|
||||
ENV HOST="0.0.0.0"
|
||||
|
||||
CMD ["node", "server/index.mjs"]
|
Loading…
Add table
Add a link
Reference in a new issue