Refactor Dockerfile and update environment configurations for improved API integration
This commit is contained in:
@@ -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"]
|
||||
|
||||
@@ -4,7 +4,9 @@
|
||||
"secure": true,
|
||||
"changeOrigin": true,
|
||||
"logLevel": "debug",
|
||||
"pathRewrite": { "^/ps": "/api" },
|
||||
"pathRewrite": {
|
||||
"^/ps": "/api"
|
||||
},
|
||||
"headers": {
|
||||
"Authorization": "Basic MkFRUEcxM01KOFgxMTdVNkZKNU5HSFBTOTNIRTM0QUI="
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export const environment = {
|
||||
production: false,
|
||||
apiUrl: 'http://localhost:3000/api',
|
||||
psUrl: '/ps'
|
||||
apiUrl: '/gameovergne-api/api',
|
||||
psUrl: '/ps',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user