Updated the Dockerfile

This commit is contained in:
Tiago Ribeiro
2023-10-15 20:16:41 +01:00
parent 069a26f900
commit 24f22abe4d

View File

@@ -2,16 +2,17 @@ FROM node:18-alpine AS build
# Install dependencies only when needed
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
RUN mkdir /app
COPY package.json /app
WORKDIR /app
# Copy and install the dependencies for the project
COPY package.json yarn.lock ./
RUN yarn
# Copy all other project files to working directory
COPY . .
ENV PORT 3000
RUN yarn
RUN yarn build
EXPOSE 3000
# Run the next build process and generate the artifacts
RUN yarn build
CMD ["node", ".next/standalone/server.js"]
CMD ["yarn", "start"]