Skip to content

Commit

Permalink
Add compatibility to heroku registry
Browse files Browse the repository at this point in the history
  • Loading branch information
hsjsjsj009 committed Mar 4, 2021
1 parent 8ea6f47 commit 3d7302e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@ RUN \
yarn build

FROM nginx:alpine
RUN apk add --no-cache bash
COPY --from=build-env /opt/app/build /var/www
COPY --from=build-env /opt/app/default.conf /etc/nginx/conf.d/default.conf
COPY --from=build-env /opt/app/envsubt.sh /etc/nginx/templates/envsubt.sh
COPY --from=build-env /opt/app/default.conf /etc/nginx/templates/default.conf.template
WORKDIR /var/www
EXPOSE 80 5000
CMD ["/bin/bash", "-c", "nginx -g \"daemon off;\""]

RUN apk add --no-cache bash

ENV PORT=80

CMD ["/bin/sh", "-c", "/etc/nginx/templates/envsubt.sh && nginx -g \"daemon off;\""]
2 changes: 1 addition & 1 deletion default.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
server {
listen 80;
listen ${PORT};
server_name localhost;
#charset koi8-r;
#access_log /var/log/nginx/host.access.log main;
Expand Down
1 change: 1 addition & 0 deletions envsubt.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
envsubst '\${PORT}' < /etc/nginx/templates/default.conf.template > /etc/nginx/conf.d/default.conf

0 comments on commit 3d7302e

Please sign in to comment.