Load .env directly via env_file so DOMAIN_SUFFIX reaches containers
Using compose-level ${DOMAIN_SUFFIX} substitution only works when docker
compose is run from the same directory as the .env file. env_file loads
the file relative to the compose file, so it works regardless of CWD.
This commit is contained in:
parent
a9490da8a8
commit
44c1bf03b4
1 changed files with 6 additions and 3 deletions
|
|
@ -28,13 +28,15 @@ services:
|
||||||
- hiy-data:/data
|
- hiy-data:/data
|
||||||
# Mount the builder script so edits take effect without rebuilding.
|
# Mount the builder script so edits take effect without rebuilding.
|
||||||
- ../builder:/app/builder:ro
|
- ../builder:/app/builder:ro
|
||||||
|
env_file:
|
||||||
|
- path: .env
|
||||||
|
required: false
|
||||||
environment:
|
environment:
|
||||||
HIY_DATA_DIR: /data
|
HIY_DATA_DIR: /data
|
||||||
HIY_ADDR: 0.0.0.0:3000
|
HIY_ADDR: 0.0.0.0:3000
|
||||||
HIY_BUILD_SCRIPT: /app/builder/build.sh
|
HIY_BUILD_SCRIPT: /app/builder/build.sh
|
||||||
CADDY_API_URL: http://caddy:2019
|
CADDY_API_URL: http://caddy:2019
|
||||||
DOCKER_HOST: tcp://docker-proxy:2375
|
DOCKER_HOST: tcp://docker-proxy:2375
|
||||||
DOMAIN_SUFFIX: ${DOMAIN_SUFFIX:-localhost}
|
|
||||||
RUST_LOG: hiy_server=debug,tower_http=info
|
RUST_LOG: hiy_server=debug,tower_http=info
|
||||||
depends_on:
|
depends_on:
|
||||||
caddy:
|
caddy:
|
||||||
|
|
@ -53,8 +55,9 @@ services:
|
||||||
- "80:80"
|
- "80:80"
|
||||||
- "443:443"
|
- "443:443"
|
||||||
- "2019:2019" # admin API
|
- "2019:2019" # admin API
|
||||||
environment:
|
env_file:
|
||||||
DOMAIN_SUFFIX: ${DOMAIN_SUFFIX:-localhost}
|
- path: .env
|
||||||
|
required: false
|
||||||
volumes:
|
volumes:
|
||||||
- ../proxy/Caddyfile:/etc/caddy/Caddyfile:ro
|
- ../proxy/Caddyfile:/etc/caddy/Caddyfile:ro
|
||||||
- caddy-data:/data
|
- caddy-data:/data
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue