diff --git a/Dockerfile b/Dockerfile index d3d1c11..4a42275 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,8 @@ COPY . . RUN ["npm", "run", "build"] -FROM dragas/thttpd +FROM nginx -COPY --from=build /code/public/ /var/www/http/ +COPY --from=build /code/public/ /usr/share/nginx/html/ + +COPY ./nginx.conf /etc/nginx/conf.d/default.conf diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..fd6718e --- /dev/null +++ b/nginx.conf @@ -0,0 +1,17 @@ +server { + listen 80; + listen [::]:80; + server_name localhost; + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri /index.html =404; + } + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +}