From ef85f6782d6db9d20e1869b05c524d3dfbf7c312 Mon Sep 17 00:00:00 2001 From: Dome Date: Fri, 28 Mar 2025 14:33:46 +0100 Subject: [PATCH] Update Dockerfile --- Dockerfile | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 62c94c8..16400a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,13 @@ -# Stage 1: Build +# Build FROM node:20.2-alpine AS build WORKDIR /app COPY package.json yarn.lock ./ -RUN yarn install --frozen-lockfile --production && yarn cache clean +RUN yarn install --frozen-lockfile COPY . . -# Stage 2: Production -FROM nginx:latest -COPY ./nginx.conf /etc/nginx/nginx.conf -COPY --from=build /app/build /usr/share/nginx/html +# Expose port 5000 +EXPOSE 5000 -# Expose port 80 -EXPOSE 80 - -# Healthcheck -HEALTHCHECK CMD curl --fail http://localhost:80 || exit 1 - -# Start Nginx server -CMD ["nginx", "-g", "daemon off;"] +# Start +ENV PORT=5000 +CMD ["yarn", "start"]