Skip to content

Commit 5e96d85

Browse files
committed
Merge branch 'improve-perf-size' into bun
2 parents 437f373 + d6066d1 commit 5e96d85

File tree

3 files changed

+71
-47
lines changed

3 files changed

+71
-47
lines changed

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ ENV NODE_OPTIONS=--max_old_space_size=8192
3939

4040
RUN bun run build
4141

42-
FROM flashspys/nginx-static
42+
FROM joseluisq/static-web-server:2
4343

4444
EXPOSE 80
4545

46-
COPY docker/nginx.conf /etc/nginx/conf.d/default.conf
47-
COPY --from=build /app/build /usr/share/nginx/html/console
46+
COPY docker/sws.toml /sws.toml
47+
COPY --from=build /app/build /public/console
48+
49+
ENV SERVER_CONFIG_FILE=/sws.toml

docker/nginx.conf

Lines changed: 0 additions & 44 deletions
This file was deleted.

docker/sws.toml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
[general]
2+
host = "::"
3+
port = 80
4+
5+
root = "/public"
6+
log-level = "error"
7+
8+
cache-control-headers = false
9+
security-headers = false
10+
11+
compression = true
12+
compression-static = true
13+
14+
directory-listing = false
15+
redirect-trailing-slash = false
16+
index-files = "index.html"
17+
page-fallback = "/console/index.html"
18+
19+
[advanced]
20+
21+
# base
22+
[[advanced.headers]]
23+
source = "/console/**"
24+
headers.Cache-Control = "no-cache, no-store, max-age=0"
25+
headers.Pragma = "no-cache"
26+
headers.Expires = "0"
27+
headers.X-UA-Compatible = "IE=Edge"
28+
headers.X-Frame-Options = "SAMEORIGIN"
29+
headers.X-XSS-Protection = "1; mode=block;"
30+
headers.X-Content-Type-Options = "nosniff"
31+
32+
# js chunks
33+
[[advanced.headers]]
34+
source = "/console/_app/immutable/**"
35+
headers.Cache-Control = "public, max-age=31536000"
36+
headers.Pragma = "public"
37+
headers.Expires = "1y"
38+
39+
# images
40+
[[advanced.headers]]
41+
source = "/console/images/**"
42+
headers.Cache-Control = "public, must-revalidate, max-age=86400"
43+
headers.Expires = "1d"
44+
45+
# css, stylesheets
46+
[[advanced.headers]]
47+
source = "/console/css/**"
48+
headers.Cache-Control = "public, must-revalidate, max-age=86400"
49+
headers.Expires = "1d"
50+
51+
# fonts
52+
[[advanced.headers]]
53+
source = "/console/fonts/**"
54+
headers.Cache-Control = "public, must-revalidate, max-age=86400"
55+
headers.Expires = "1d"
56+
57+
# icons
58+
[[advanced.headers]]
59+
source = "/console/icons/**"
60+
headers.Cache-Control = "public, must-revalidate, max-age=86400"
61+
headers.Expires = "1d"
62+
63+
[[advanced.redirects]]
64+
source = "/"
65+
destination = "/console"
66+
kind = 301

0 commit comments

Comments
 (0)