-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
39 lines (34 loc) · 1.22 KB
/
Copy pathDockerfile
File metadata and controls
39 lines (34 loc) · 1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
FROM eclipse-temurin:25-jdk AS builder
WORKDIR /build
RUN apt-get update \
&& apt-get install -y --no-install-recommends libatomic1 dos2unix \
&& rm -rf /var/lib/apt/lists/*
COPY . .
ENV TAMMY_BUILD_FLAVOR=PROD
ENV NODE_OPTIONS="--max-old-space-size=4096"
RUN dos2unix gradlew && ./gradlew packageReleaseWebZip
FROM nginx:alpine
COPY --from=builder /build/build/dist/composeWebCompatibility/productionExecutable/ /usr/share/nginx/html/
RUN cat > /etc/nginx/conf.d/default.conf <<'EOF'
server {
listen 80;
server_name _;
root /usr/share/nginx/html;
index index.html;
# Ensure SPA shell is always refreshed after deployments.
location = /index.html {
add_header Cache-Control "no-cache, no-store, must-revalidate" always;
add_header Pragma "no-cache" always;
add_header Expires "0" always;
}
# Never rewrite missing static files to index.html.
# This avoids white pages when stale cached bundles request removed chunks.
location ~* \.(js|css|wasm|map|json|ico|png|jpg|jpeg|gif|svg|webp|woff2?)$ {
try_files $uri =404;
add_header Cache-Control "no-cache, must-revalidate" always;
}
location / {
try_files $uri $uri/ /index.html;
}
}
EOF