diff --git a/Dockerfile.web b/Dockerfile.web index 51984ef..3b43c71 100644 --- a/Dockerfile.web +++ b/Dockerfile.web @@ -10,6 +10,7 @@ RUN npx expo export --platform web --output-dir dist-web FROM nginx:1.27-alpine +COPY nginx.conf /etc/nginx/conf.d/default.conf COPY --from=builder /app/dist-web /usr/share/nginx/html EXPOSE 80 diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..3f98ed2 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,19 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + } + + gzip on; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript image/svg+xml; + gzip_min_length 256; +}