File tree 2 files changed +33
-1
lines changed
2 files changed +33
-1
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,14 @@ RUN pnpm fetch
13
13
COPY . /app
14
14
RUN pnpm run build
15
15
16
- FROM steebchen/nginx-spa:stable
16
+ FROM nginx:stable-alpine
17
+
18
+ RUN sed -i '1idaemon off;' /etc/nginx/nginx.conf
19
+
20
+ COPY nginx.conf /etc/nginx/conf.d/default.conf
21
+
17
22
COPY --from=prod /app/dist/ /app
23
+
18
24
EXPOSE 80
25
+
19
26
CMD [ "nginx" ]
Original file line number Diff line number Diff line change
1
+ server {
2
+ listen 80 default_server ;
3
+
4
+ gzip on ;
5
+ gzip_min_length 1000 ;
6
+ gzip_types text/plain text/xml application/javascript text/css;
7
+
8
+ root /app;
9
+
10
+ # normal routes
11
+ # serve given url and default to index.html if not found
12
+ # e.g. /, /user and /foo/bar will return index.html
13
+ location / {
14
+ add_header Cache-Control "no-store" ;
15
+ try_files $uri $uri /index.html /index.html;
16
+ }
17
+
18
+ # files
19
+ # for all routes matching a dot, check for files and return 404 if not found
20
+ # e.g. /file.js returns a 404 if not found
21
+ location ~ \.(?!html) {
22
+ add_header Cache-Control "public, max-age=2678400" ;
23
+ try_files $uri =404 ;
24
+ }
25
+ }
You can’t perform that action at this time.
0 commit comments