Updated the Dockerfile
This commit is contained in:
15
Dockerfile
15
Dockerfile
@@ -2,16 +2,17 @@ FROM node:18-alpine AS build
|
|||||||
# Install dependencies only when needed
|
# Install dependencies only when needed
|
||||||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be 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 apk add --no-cache libc6-compat
|
||||||
|
|
||||||
|
RUN mkdir /app
|
||||||
|
COPY package.json /app
|
||||||
WORKDIR /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 . .
|
COPY . .
|
||||||
|
|
||||||
ENV PORT 3000
|
RUN yarn
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
# Run the next build process and generate the artifacts
|
# Run the next build process and generate the artifacts
|
||||||
RUN yarn build
|
CMD ["yarn", "start"]
|
||||||
CMD ["node", ".next/standalone/server.js"]
|
|
||||||
Reference in New Issue
Block a user