mirror of
https://github.com/DefectingCat/DefectingCat.github.io
synced 2025-07-15 16:51:37 +00:00
update dockerfile
This commit is contained in:
@ -1,5 +1,8 @@
|
||||
# FROM node:18-alpine AS base
|
||||
FROM node:lts-alpine AS base
|
||||
|
||||
# Install dependencies only when needed
|
||||
FROM node:lts-alpine AS deps
|
||||
FROM base AS deps
|
||||
WORKDIR /app
|
||||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
||||
|
||||
@ -16,7 +19,7 @@ RUN \
|
||||
fi
|
||||
|
||||
# Rebuild the source code only when needed
|
||||
FROM node:lts-alpine AS builder
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
@ -61,5 +64,6 @@ USER nextjs
|
||||
EXPOSE 3000
|
||||
|
||||
ENV PORT 3000
|
||||
ENV HOSTNAME localhost
|
||||
|
||||
CMD ["node", "server.js"]
|
||||
|
Reference in New Issue
Block a user