diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..3c3629e --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +node_modules diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7ceb140 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM nginx:alpine + +RUN rm /usr/share/nginx/html/index.html +COPY build /usr/share/nginx/html + +COPY conf/default.conf.template /etc/nginx/templates/default.conf.template +EXPOSE 5000 +CMD ["nginx", "-g", "daemon off;"] diff --git a/conf/default.conf.template b/conf/default.conf.template new file mode 100644 index 0000000..5e70ff1 --- /dev/null +++ b/conf/default.conf.template @@ -0,0 +1,27 @@ +server { + listen 5000; + server_name localhost; + + location / { + root /usr/share/nginx/html; + try_files $uri /index.html; + } + + location /service-worker.js { + alias /usr/share/nginx/html/service-worker.js; + add_header Cache-Control "no-cache"; + proxy_cache_bypass $http_pragma; + expires off; + access_log off; + } + + location = /config.js { + alias /usr/share/nginx/html/environments/${CONFIG}; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + +}