File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed
Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -21,8 +21,8 @@ FROM nginx:alpine
2121# Copy built static files from builder
2222COPY --from=builder /app/dist/temp/browser /usr/share/nginx/html
2323
24- # Copy nginx configuration (optional)
25- # COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
24+ # Copy nginx configuration
25+ COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
2626
2727# Expose port 80
2828EXPOSE 80
Original file line number Diff line number Diff line change 1+ server {
2+ listen 80 ;
3+ server_name localhost;
4+ root /usr/share/nginx/html;
5+ index index .html;
6+
7+ # Enable gzip compression
8+ gzip on;
9+ gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
10+
11+ # Serve static files
12+ location / {
13+ try_files $uri $uri / /index .html;
14+ }
15+
16+ # Cache static assets
17+ location ~ * \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
18+ expires 1y ;
19+ add_header Cache-Control "public, immutable" ;
20+ }
21+
22+ # Don't cache index.html
23+ location = /index .html {
24+ add_header Cache-Control "no-cache, no-store, must-revalidate" ;
25+ add_header Pragma "no-cache" ;
26+ add_header Expires "0" ;
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments