Update with assets path

This commit is contained in:
TheMaddax 2024-12-09 18:36:56 -06:00
parent 6365a2ecb2
commit da49f378c6
2 changed files with 32 additions and 3 deletions

View file

@ -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

View file

@ -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;