fix(coolify): add Traefik routing labels, coolify network, and zero-cache CDN headers

This commit is contained in:
khondokartowsif171
2026-09-05 06:28:26 +06:00
parent 9b1ec81647
commit 5ec264c8bc
2 changed files with 41 additions and 13 deletions
+21 -4
View File
@@ -2,10 +2,27 @@ version: '3.8'
services:
opal-ios-studio:
build: .
restart: always
build:
context: .
dockerfile: Dockerfile
container_name: opal-ios-studio
ports:
- "80"
restart: always
environment:
- NODE_ENV=production
- PORT=80
networks:
- coolify
labels:
- "traefik.enable=true"
- "traefik.http.routers.opal-studio-http.entrypoints=http"
- "traefik.http.routers.opal-studio-http.rule=Host(`opal.auraajenticai.cloud`)"
- "traefik.http.routers.opal-studio-http.middlewares=redirect-to-https"
- "traefik.http.routers.opal-studio-https.entrypoints=https"
- "traefik.http.routers.opal-studio-https.rule=Host(`opal.auraajenticai.cloud`)"
- "traefik.http.routers.opal-studio-https.tls=true"
- "traefik.http.routers.opal-studio-https.tls.certresolver=letsencrypt"
- "traefik.http.services.opal-studio-svc.loadbalancer.server.port=80"
networks:
coolify:
external: true
+20 -9
View File
@@ -17,20 +17,31 @@ server {
add_header X-Content-Type-Options "nosniff";
add_header Access-Control-Allow-Origin "*";
# HTML pages must NEVER be cached by browser/CDN
location / {
try_files $uri $uri/ /index.html;
}
# Cache Service Worker with no-cache so updates apply immediately
location = /sw.js {
add_header Cache-Control "no-cache, no-store, must-revalidate";
add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0";
add_header Pragma "no-cache";
add_header Expires "0";
}
# Static assets cache
location ~* \.(css|js|json|svg|png|jpg|jpeg|ico)$ {
expires 7d;
add_header Cache-Control "public, max-age=604800, immutable";
# Cache Service Worker with no-cache so updates apply immediately
location = /sw.js {
add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0";
add_header Pragma "no-cache";
add_header Expires "0";
}
# Static assets with revalidation
location ~* \.(css|js|json)$ {
add_header Cache-Control "no-cache, must-revalidate, max-age=0";
add_header Pragma "no-cache";
add_header Expires "0";
}
# Images & icons
location ~* \.(svg|png|jpg|jpeg|ico|webp)$ {
expires 1d;
add_header Cache-Control "public, max-age=86400";
}
}