From 20f8073fdf5b4a40b386d5fc9a8ec3fafafa21a0 Mon Sep 17 00:00:00 2001 From: Ivan Pushkin Date: Sat, 9 Jul 2022 17:19:08 +0200 Subject: [PATCH] build: use nginx image as a base instead of scratch Issue: #85 --- Dockerfile | 6 +++++- nginx/snake.conf | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 nginx/snake.conf diff --git a/Dockerfile b/Dockerfile index 1236da7..345fb7b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,11 @@ RUN yarn install \ && yarn run lint \ && yarn build -FROM scratch +FROM nginx:1.23.0-alpine + +RUN rm -f /etc/nginx/conf.d/default.conf + +COPY nginx/snake.conf /etc/nginx/conf.d/ COPY --from=builder /usr/local/app/dist \ /usr/local/share/snake-lightweight-client diff --git a/nginx/snake.conf b/nginx/snake.conf new file mode 100644 index 0000000..181dc3d --- /dev/null +++ b/nginx/snake.conf @@ -0,0 +1,14 @@ +server { + listen 80; + server_name localhost; + + location / { + root /usr/local/share/snake-lightweight-client; + index index.html index.htm; + } + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } +}