Skip to content

Commit

Permalink
update docker image to support manifest mimetype
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzopicoli committed Jan 14, 2025
1 parent 08e6cac commit af33e69
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ FROM ubuntu
RUN apt-get update
RUN apt-get install nginx -y
COPY --from=build /app/dist /var/www/html/
# COPY nginx.conf /etc/nginx/
COPY nginx.conf /etc/nginx/
EXPOSE 80
CMD ["nginx","-g","daemon off;"]
41 changes: 41 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
user www-data;
worker_processes auto;
pid /run/nginx.pid;

events {
worker_connections 768;
}

http {
include mime.types;
types {
application/manifest+json webmanifest;
}

server {
listen 80;
server_name localhost;
root /var/www/html;
index index.html;

# Cache control for static assets
location ^~ /assets/ {
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
try_files $uri =404;
}

# Cache control for workbox scripts
location ^~ /workbox- {
add_header Cache-Control "public, max-age=31536000, s-maxage=31536000, immutable";
try_files $uri =404;
}

# Default location with no caching
location / {
autoindex off;
expires off;
add_header Cache-Control "public, max-age=0, s-maxage=0, must-revalidate" always;
try_files $uri /index.html =404;
}
}
}

0 comments on commit af33e69

Please sign in to comment.