Skip to content

Commit

Permalink
build: use nginx image as a base instead of scratch
Browse files Browse the repository at this point in the history
Issue: #85
  • Loading branch information
ivan1993spb committed Jul 9, 2022
1 parent 327fced commit 20f8073
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions nginx/snake.conf
Original file line number Diff line number Diff line change
@@ -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;
}
}

0 comments on commit 20f8073

Please sign in to comment.