diff --git a/Dockerfile b/Dockerfile index 3e7832a..6362840 100644 --- a/Dockerfile +++ b/Dockerfile @@ -26,9 +26,9 @@ FROM nginx:alpine AS runner # Copy built app and static assets COPY --from=builder /app/dist /usr/share/nginx/html -COPY --from=builder /app/public/images /usr/share/nginx/html/images -COPY --from=builder /app/public/subtitles /usr/share/nginx/html/subtitles -COPY --from=builder /app/public/transcriptions /usr/share/nginx/html/transcriptions +COPY public/images /usr/share/nginx/html/images +COPY public/subtitles /usr/share/nginx/html/subtitles +COPY public/transcriptions /usr/share/nginx/html/transcriptions COPY nginx.conf /etc/nginx/conf.d/default.conf # Create videos directory for volume mount diff --git a/nginx.conf b/nginx.conf index 81946c7..ee785af 100644 --- a/nginx.conf +++ b/nginx.conf @@ -31,6 +31,35 @@ server { add_header Accept-Ranges bytes; } + # Images handling + location /images/ { + alias /usr/share/nginx/html/images/; + add_header Cache-Control "public, no-transform"; + types { + image/png png; + image/jpeg jpg jpeg; + image/svg+xml svg; + } + } + + # Subtitles handling + location /subtitles/ { + alias /usr/share/nginx/html/subtitles/; + add_header Cache-Control "public, no-transform"; + types { + text/vtt vtt; + } + } + + # Transcriptions handling + location /transcriptions/ { + alias /usr/share/nginx/html/transcriptions/; + add_header Cache-Control "public, no-transform"; + types { + text/plain txt; + } + } + # Static asset caching location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|vtt|txt)$ { expires 30d;