diff --git a/containers/quartz/Dockerfile b/containers/quartz/Dockerfile index 5701990..63e5757 100644 --- a/containers/quartz/Dockerfile +++ b/containers/quartz/Dockerfile @@ -11,42 +11,11 @@ FROM nginx:alpine # Install curl for downloading release assets RUN apk add --no-cache curl -# Copy startup script +# Copy startup script and nginx config COPY start.sh /start.sh +COPY default.conf /etc/nginx/conf.d/default.conf RUN chmod +x /start.sh -# Custom nginx config for SPA routing -RUN cat > /etc/nginx/conf.d/default.conf << 'EOF' -server { - listen 80; - server_name _; - root /usr/share/nginx/html; - index index.html; - - # Enable gzip compression - gzip on; - gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript; - - # Cache static assets - location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { - expires 1y; - add_header Cache-Control "public, immutable"; - } - - # SPA fallback - serve index.html for client-side routing - location / { - try_files $uri $uri/ $uri.html /index.html; - } - - # Health check endpoint - location /healthz { - access_log off; - return 200 "ok\n"; - add_header Content-Type text/plain; - } -} -EOF - EXPOSE 80 CMD ["/start.sh"] diff --git a/containers/quartz/default.conf b/containers/quartz/default.conf new file mode 100644 index 0000000..4009101 --- /dev/null +++ b/containers/quartz/default.conf @@ -0,0 +1,28 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + # Enable gzip compression + gzip on; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml text/javascript; + + # Cache static assets + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } + + # SPA fallback - serve index.html for client-side routing + location / { + try_files $uri $uri/ $uri.html /index.html; + } + + # Health check endpoint + location /healthz { + access_log off; + return 200 "ok\n"; + add_header Content-Type text/plain; + } +}