diff --git a/dockerfile b/dockerfile index 11ced6b..c943116 100644 --- a/dockerfile +++ b/dockerfile @@ -18,4 +18,5 @@ RUN npm run build FROM nginx:alpine COPY --from=builder /app/out /usr/share/nginx/html +COPY nginx.conf /etc/nginx/conf.d/default.conf EXPOSE 80 \ No newline at end of file diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..189a902 --- /dev/null +++ b/nginx.conf @@ -0,0 +1,15 @@ +server { + listen 80; + server_name game; + + root /usr/share/nginx/html; + index index.html; + + location / { + try_files $uri $uri/ /index.html; + } + + location /serwist/ { + add_header Service-Worker-Allowed "/"; + } +} \ No newline at end of file