Created
July 19, 2021 23:00
-
-
Save felipewind/8aea2672f1241762df5949c703095096 to your computer and use it in GitHub Desktop.
Heroku Angular/Nginx Dockerfile example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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