Skip to content

Commit 1c0d4ba

Browse files
committed
nginx conf
1 parent 24b9648 commit 1c0d4ba

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

Dockerfile.ui

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ FROM nginx:1.21.5-alpine AS production
2222

2323
# Copier les fichiers de build depuis l'étape de build
2424
COPY --from=build /app/dist /usr/share/nginx/html
25+
COPY --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf
2526

2627
# Exposer le port 80
2728
EXPOSE 80

front/nginx.conf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
server {
2+
listen 80;
3+
root /usr/share/nginx/html;
4+
5+
# Compression
6+
gzip on;
7+
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
8+
9+
location / {
10+
try_files $uri $uri/ /index.html;
11+
add_header Cache-Control "no-store, no-cache, must-revalidate";
12+
}
13+
14+
# Static assets caching
15+
location /assets {
16+
expires 1y;
17+
add_header Cache-Control "public";
18+
access_log off;
19+
}
20+
}

0 commit comments

Comments
 (0)