FROM nginx:alpine
# no-cache => browsers revalidate every request (ETag 304s are cheap), so a new
# deploy is picked up on plain reload. ponytail: switch to hashed filenames if traffic ever matters.
# The exact-match location gives the manifest its own MIME type — nginx's default map has no
# .webmanifest entry and Chrome refuses to install a homescreen app served as octet-stream.
# (a bare `types {}` block would have REPLACED the whole map and broken .js/.png too.)
RUN printf 'server {\n  listen 80;\n  root /usr/share/nginx/html;\n  etag on;\n  location = /manifest.webmanifest { default_type application/manifest+json; add_header Cache-Control "no-cache, must-revalidate"; }\n  location / { add_header Cache-Control "no-cache, must-revalidate"; }\n}\n' > /etc/nginx/conf.d/default.conf
COPY index.html manifest.webmanifest *.js /usr/share/nginx/html/
COPY assets /usr/share/nginx/html/assets
