From 1db7b9da80ad45541ad87584e4cf485296067271 Mon Sep 17 00:00:00 2001 From: "theis.gaedigk" Date: Fri, 25 Jul 2025 12:45:39 +0200 Subject: [PATCH] changed ports for docker file and added build and production stage --- frontend_admin/Dockerfile | 15 ++++++++------- frontend_user/Dockerfile | 15 ++++++++------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/frontend_admin/Dockerfile b/frontend_admin/Dockerfile index f82bdae..4aec001 100644 --- a/frontend_admin/Dockerfile +++ b/frontend_admin/Dockerfile @@ -1,12 +1,13 @@ -FROM node:20-alpine - +# Build Stage +FROM node:20-alpine AS build WORKDIR /app - COPY package*.json ./ RUN npm install - COPY . . - +RUN npm run build + +# Production Stage +FROM nginx:stable-alpine AS production +COPY --from=build /app/build /usr/share/nginx/html EXPOSE 5001 - -CMD ["npm", "start"] +CMD ["nginx", "-g", "daemon off;"] diff --git a/frontend_user/Dockerfile b/frontend_user/Dockerfile index 0ed3814..f29ba80 100644 --- a/frontend_user/Dockerfile +++ b/frontend_user/Dockerfile @@ -1,12 +1,13 @@ -FROM node:20-alpine - +# Build Stage +FROM node:20-alpine AS build WORKDIR /app - COPY package*.json ./ RUN npm install - COPY . . - +RUN npm run build + +# Production Stage +FROM nginx:stable-alpine AS production +COPY --from=build /app/build /usr/share/nginx/html EXPOSE 5003 - -CMD ["npm", "start"] +CMD ["nginx", "-g", "daemon off;"]