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 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
CMD ["npx", "ng", "serve", "--host", "0.0.0.0", "--port", "4200", "--configuration", "production", "--proxy-config", "proxy.conf.json"]

View File

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

View File

@@ -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',
};

View File

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