From 669a4cbe006b5fa6becf39a8c0d6e3309b7d7081 Mon Sep 17 00:00:00 2001 From: Vincent Guillet Date: Fri, 28 Nov 2025 12:10:50 +0100 Subject: [PATCH] Refactor Dockerfile and update environment configurations for improved API integration --- client/Dockerfile | 16 +++++----------- client/proxy.conf.json | 4 +++- client/src/environments/environment.prod.ts | 6 +++--- client/src/environments/environment.ts | 4 ++-- 4 files changed, 13 insertions(+), 17 deletions(-) diff --git a/client/Dockerfile b/client/Dockerfile index c476bd0..1ccd51c 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,18 +1,12 @@ -# Build Angular -FROM node:20 AS build +FROM node:20-alpine WORKDIR /app + COPY package*.json ./ -RUN npm install +RUN npm ci COPY . . -RUN npm run build +EXPOSE 4200 -# NGINX final -FROM nginx:stable - -COPY --from=build /app/dist/client/browser /usr/share/nginx/html -COPY nginx.conf /etc/nginx/conf.d/default.conf - -EXPOSE 80 \ No newline at end of file +CMD ["npx", "ng", "serve", "--host", "0.0.0.0", "--port", "4200", "--configuration", "production", "--proxy-config", "proxy.conf.json"] diff --git a/client/proxy.conf.json b/client/proxy.conf.json index 3c46c51..afbbfd0 100644 --- a/client/proxy.conf.json +++ b/client/proxy.conf.json @@ -4,7 +4,9 @@ "secure": true, "changeOrigin": true, "logLevel": "debug", - "pathRewrite": { "^/ps": "/api" }, + "pathRewrite": { + "^/ps": "/api" + }, "headers": { "Authorization": "Basic MkFRUEcxM01KOFgxMTdVNkZKNU5HSFBTOTNIRTM0QUI=" } diff --git a/client/src/environments/environment.prod.ts b/client/src/environments/environment.prod.ts index 7e67379..2282731 100644 --- a/client/src/environments/environment.prod.ts +++ b/client/src/environments/environment.prod.ts @@ -1,5 +1,5 @@ export const environment = { - production: true, - apiUrl: 'https://dev.vincent-guillet.fr/gameovergne-api/api', - psUrl: '/gameovergne/ps' + production: false, + apiUrl: '/gameovergne-api/api', + psUrl: '/ps', }; diff --git a/client/src/environments/environment.ts b/client/src/environments/environment.ts index 63de950..2282731 100644 --- a/client/src/environments/environment.ts +++ b/client/src/environments/environment.ts @@ -1,5 +1,5 @@ export const environment = { production: false, - apiUrl: 'http://localhost:3000/api', - psUrl: '/ps' + apiUrl: '/gameovergne-api/api', + psUrl: '/ps', };