Skip to content

Instantly share code, notes, and snippets.

@balintsera
Created October 1, 2017 08:28
Show Gist options
  • Save balintsera/4bb3c173a93a89e7094ef12b57af4b3b to your computer and use it in GitHub Desktop.
Save balintsera/4bb3c173a93a89e7094ef12b57af4b3b to your computer and use it in GitHub Desktop.
Use environment variable in an Nginx container using templating
version: "3"
services:
vhostfront:
image: repository/vhostmon/vhostfront:latest
environment:
- APP_CONF=config={"baseUrl":"http://localhost:8081"}
ports:
- "8085:80"
command: ["sh", "-c", "envsubst < /etc/nginx/conf.d/deafault.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