Skip to content

Commit

Permalink
Group Dockerfile blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
ai committed May 20, 2024
1 parent aa92982 commit b6218c8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions web/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# Web server to serve web client for staging and pull request previews

FROM nginx:alpine

ENV PORT=8080

RUN rm -R /etc/nginx/conf.d
COPY ./nginx.conf /etc/nginx/nginx.template
COPY ./routes.regexp /etc/nginx/routes.regexp
RUN awk 'NR==FNR{a=$0;next} {gsub("__ROUTES__", a)}1' /etc/nginx/routes.regexp /etc/nginx/nginx.template > /etc/nginx/filled.template
RUN mv /etc/nginx/filled.template /etc/nginx/nginx.template

COPY ./dist/ /var/www/

CMD envsubst \$PORT < /etc/nginx/nginx.template > /etc/nginx/nginx.conf && nginx

0 comments on commit b6218c8

Please sign in to comment.