docker support
This commit is contained in:
parent
3bd4feb0ed
commit
5530756407
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
.next/
|
||||||
|
.env*
|
||||||
|
node_modules/
|
44
Dockerfile
Normal file
44
Dockerfile
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
###################
|
||||||
|
# DEPENDENCIES
|
||||||
|
###################
|
||||||
|
FROM node:18-alpine AS deps
|
||||||
|
RUN apk add --no-cache libc6-compat
|
||||||
|
USER node
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --chown=node:node package*.json ./
|
||||||
|
RUN npm ci
|
||||||
|
|
||||||
|
###################
|
||||||
|
# BUILDER
|
||||||
|
###################
|
||||||
|
FROM node:18-alpine AS builder
|
||||||
|
|
||||||
|
USER node
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY --chown=node:node --from=deps /app/node_modules ./node_modules
|
||||||
|
COPY --chown=node:node . .
|
||||||
|
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
RUN npm ci --omit=dev && npm cache clean --force
|
||||||
|
|
||||||
|
###################
|
||||||
|
# PRODUCTION
|
||||||
|
###################
|
||||||
|
FROM node:18-alpine AS runner
|
||||||
|
|
||||||
|
USER node
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
ENV NODE_ENV production
|
||||||
|
|
||||||
|
COPY --chown=node:node --from=builder /app/node_modules ./node_modules
|
||||||
|
COPY --chown=node:node --from=builder /app/package*.json ./
|
||||||
|
|
||||||
|
COPY --chown=node:node --from=builder /app/public ./public
|
||||||
|
COPY --chown=node:node --from=builder /app/.next ./.next
|
||||||
|
|
||||||
|
EXPOSE 3000
|
||||||
|
|
||||||
|
CMD ["node_modules/.bin/next", "start"]
|
Reference in New Issue
Block a user