Update Dockerfile
This commit is contained in:
+7
-16
@@ -1,22 +1,13 @@
|
|||||||
# Stage 1: Build
|
# Build
|
||||||
FROM node:20.2-alpine AS build
|
FROM node:20.2-alpine AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY package.json yarn.lock ./
|
COPY package.json yarn.lock ./
|
||||||
RUN yarn install --frozen-lockfile --production && yarn cache clean
|
RUN yarn install --frozen-lockfile
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Stage 2: Production
|
# Expose port 5000
|
||||||
FROM nginx:latest
|
EXPOSE 5000
|
||||||
WORKDIR /etc/nginx
|
|
||||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
|
||||||
WORKDIR /usr/share/nginx/html
|
|
||||||
COPY --from=build /app/build .
|
|
||||||
|
|
||||||
# Expose port 80
|
# Start
|
||||||
EXPOSE 80
|
ENV PORT=5000
|
||||||
|
CMD ["yarn", "start"]
|
||||||
# Healthcheck
|
|
||||||
HEALTHCHECK CMD curl --fail http://localhost:80 || exit 1
|
|
||||||
|
|
||||||
# Start Nginx server
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user