Refactor Dockerfile and update environment configurations for improved API integration

This commit is contained in:
Vincent Guillet
2025-11-28 12:10:50 +01:00
parent b98995b7ae
commit 669a4cbe00
4 changed files with 13 additions and 17 deletions

View File

@@ -1,18 +1,12 @@
# Build Angular FROM node:20-alpine
FROM node:20 AS build
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN npm install RUN npm ci
COPY . . COPY . .
RUN npm run build
EXPOSE 4200
# NGINX final CMD ["npx", "ng", "serve", "--host", "0.0.0.0", "--port", "4200", "--configuration", "production", "--proxy-config", "proxy.conf.json"]
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

View File

@@ -4,7 +4,9 @@
"secure": true, "secure": true,
"changeOrigin": true, "changeOrigin": true,
"logLevel": "debug", "logLevel": "debug",
"pathRewrite": { "^/ps": "/api" }, "pathRewrite": {
"^/ps": "/api"
},
"headers": { "headers": {
"Authorization": "Basic MkFRUEcxM01KOFgxMTdVNkZKNU5HSFBTOTNIRTM0QUI=" "Authorization": "Basic MkFRUEcxM01KOFgxMTdVNkZKNU5HSFBTOTNIRTM0QUI="
} }

View File

@@ -1,5 +1,5 @@
export const environment = { export const environment = {
production: true, production: false,
apiUrl: 'https://dev.vincent-guillet.fr/gameovergne-api/api', apiUrl: '/gameovergne-api/api',
psUrl: '/gameovergne/ps' psUrl: '/ps',
}; };

View File

@@ -1,5 +1,5 @@
export const environment = { export const environment = {
production: false, production: false,
apiUrl: 'http://localhost:3000/api', apiUrl: '/gameovergne-api/api',
psUrl: '/ps' psUrl: '/ps',
}; };