File tree Expand file tree Collapse file tree 2 files changed +20
-18
lines changed
Expand file tree Collapse file tree 2 files changed +20
-18
lines changed Original file line number Diff line number Diff line change @@ -24,24 +24,7 @@ RUN pnpm run build
2424# Final stage - minimal nginx
2525FROM nginx:alpine
2626
27- # Static site routing + caching for static assets
28- RUN printf 'server {\n \
29- listen 80;\n \
30- root /usr/share/nginx/html;\n \
31- error_page 404 /404.html;\n \
32- location / {\n \
33- try_files $uri $uri/ $uri.html =404;\n \
34- }\n \
35- location ~* \\ .md$ {\n \
36- types { text/plain md; }\n \
37- add_header Content-Disposition "inline";\n \
38- }\n \
39- location ~* \\ .(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {\n \
40- expires 1y;\n \
41- add_header Cache-Control "public, immutable";\n \
42- }\n \
43- }' > /etc/nginx/conf.d/default.conf
44-
27+ COPY nginx.conf /etc/nginx/conf.d/default.conf
4528COPY --from=build /app/dist /usr/share/nginx/html
4629
4730EXPOSE 80
Original file line number Diff line number Diff line change 1+ server {
2+ listen 80 ;
3+ root /usr/share/nginx/html;
4+ error_page 404 /404 .html;
5+
6+ location / {
7+ try_files $uri $uri / $uri .html =404 ;
8+ }
9+
10+ location ~ * \.md$ {
11+ types { text/plain md; }
12+ add_header Content-Disposition "inline" ;
13+ }
14+
15+ location ~ * \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ {
16+ expires 1y ;
17+ add_header Cache-Control "public, immutable" ;
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments