fix(coolify): add Traefik routing labels, coolify network, and zero-cache CDN headers
This commit is contained in:
+21
-4
@@ -2,10 +2,27 @@ version: '3.8'
|
|||||||
|
|
||||||
services:
|
services:
|
||||||
opal-ios-studio:
|
opal-ios-studio:
|
||||||
build: .
|
build:
|
||||||
restart: always
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
container_name: opal-ios-studio
|
container_name: opal-ios-studio
|
||||||
ports:
|
restart: always
|
||||||
- "80"
|
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=production
|
- 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
@@ -17,20 +17,31 @@ server {
|
|||||||
add_header X-Content-Type-Options "nosniff";
|
add_header X-Content-Type-Options "nosniff";
|
||||||
add_header Access-Control-Allow-Origin "*";
|
add_header Access-Control-Allow-Origin "*";
|
||||||
|
|
||||||
|
# HTML pages must NEVER be cached by browser/CDN
|
||||||
location / {
|
location / {
|
||||||
try_files $uri $uri/ /index.html;
|
try_files $uri $uri/ /index.html;
|
||||||
}
|
add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0";
|
||||||
|
|
||||||
# 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 Pragma "no-cache";
|
add_header Pragma "no-cache";
|
||||||
add_header Expires "0";
|
add_header Expires "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
# Static assets cache
|
# Cache Service Worker with no-cache so updates apply immediately
|
||||||
location ~* \.(css|js|json|svg|png|jpg|jpeg|ico)$ {
|
location = /sw.js {
|
||||||
expires 7d;
|
add_header Cache-Control "no-cache, no-store, must-revalidate, max-age=0";
|
||||||
add_header Cache-Control "public, max-age=604800, immutable";
|
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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user