🐳 add Dockerfile (#17)

Co-authored-by: dev <dev@ptfprod7>
This commit is contained in:
Thomas LÉVEIL
2023-03-19 13:49:41 +01:00
committed by GitHub
parent 7e6651dea7
commit 5da68bbdd4
4 changed files with 48 additions and 0 deletions
+27
View File
@@ -0,0 +1,27 @@
# ---- Base Node ----
FROM node:19-alpine AS base
WORKDIR /app
COPY package*.json ./
# ---- Dependencies ----
FROM base AS dependencies
RUN npm ci
# ---- Build ----
FROM dependencies AS build
COPY . .
RUN npm run build
# ---- Production ----
FROM node:19-alpine AS production
WORKDIR /app
COPY --from=dependencies /app/node_modules ./node_modules
COPY --from=build /app/.next ./.next
COPY --from=build /app/public ./public
COPY --from=build /app/package*.json ./
# Expose the port the app will run on
EXPOSE 3000
# Start the application
CMD ["npm", "start"]