update dockerfile and nginx config

This commit is contained in:
guams 2025-06-18 11:33:01 +02:00
parent 8771bbd9ca
commit 45d1abccfe
3 changed files with 25 additions and 8 deletions

View File

@ -1,10 +1,9 @@
FROM node:alpine
FROM nginx:alpine
WORKDIR /usr/src/app
COPY ./dist/review-front/browser /usr/share/nginx/html
COPY . /usr/src/app
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
RUN npm install -g @angular/cli
RUN npm install
EXPOSE 80
CMD ["ng", "serve", "--host", "0.0.0.0"]
CMD ["nginx", "-g", "daemon off;"]

View File

@ -11,8 +11,13 @@
- [ ] Terminer l'interface admin
- [x] Bug (de temps en temps) pour stocker les données utilisateur
avant de run le docker
```
npm i
ng build --configuration=production
```
pour run le docker :
```
sudo docker build -t abonentendeur .
sudo docker run -d -p 4200:4200 abonentendeur
sudo docker build -t abonentendeur-prod .
sudo docker run -d -p 4200:80 abonentendeur-prod
```

13
nginx.conf Normal file
View File

@ -0,0 +1,13 @@
server {
listen 80;
server_name localhost;
root /usr/share/nginx/html;
index index.html index.htm;
location / {
try_files $uri $uri/ /index.html;
}
error_page 404 /index.html;
}