Update Dockerfile
This commit is contained in:
+14
-7
@@ -1,13 +1,20 @@
|
|||||||
# Build
|
# Stage 1: 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
|
RUN yarn install --frozen-lockfile --production && yarn cache clean
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Expose port 5000
|
# Stage 2: Production
|
||||||
EXPOSE 5000
|
FROM nginx:latest
|
||||||
|
COPY ./nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY --from=build /app/build /usr/share/nginx/html
|
||||||
|
|
||||||
# Start
|
# Expose port 80
|
||||||
ENV PORT=5000
|
EXPOSE 80
|
||||||
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