Skip to content

Instantly share code, notes, and snippets.

@felipewind
Created July 19, 2021 23:00
Show Gist options
  • Save felipewind/8aea2672f1241762df5949c703095096 to your computer and use it in GitHub Desktop.
Save felipewind/8aea2672f1241762df5949c703095096 to your computer and use it in GitHub Desktop.
Heroku Angular/Nginx Dockerfile example
FROM nginx:latest
COPY dist/heroku /usr/share/nginx/html
COPY ./nginx/default.conf.template /etc/nginx/conf.d/default.conf.template
CMD ["/bin/bash", "-c", \
"echo API_URL=[$API_URL], && \
echo PORT=[$PORT], && \
sed -i s#HEROKU_API_URL#$API_URL#g /usr/share/nginx/html/main.*.js && \
envsubst '$PORT' < /etc/nginx/conf.d/default.conf.template > /etc/nginx/conf.d/default.conf && \
nginx -g 'daemon off;'"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment