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
|
||||
# Mount the builder script so edits take effect without rebuilding.
|
||||
- ../builder:/app/builder:ro
|
||||
env_file:
|
||||
- path: .env
|
||||
required: false
|
||||
environment:
|
||||
HIY_DATA_DIR: /data
|
||||
HIY_ADDR: 0.0.0.0:3000
|
||||
HIY_BUILD_SCRIPT: /app/builder/build.sh
|
||||
CADDY_API_URL: http://caddy:2019
|
||||
DOCKER_HOST: tcp://docker-proxy:2375
|
||||
DOMAIN_SUFFIX: ${DOMAIN_SUFFIX:-localhost}
|
||||
RUST_LOG: hiy_server=debug,tower_http=info
|
||||
depends_on:
|
||||
caddy:
|
||||
|
|
@ -53,8 +55,9 @@ services:
|
|||
- "80:80"
|
||||
- "443:443"
|
||||
- "2019:2019" # admin API
|
||||
environment:
|
||||
DOMAIN_SUFFIX: ${DOMAIN_SUFFIX:-localhost}
|
||||
env_file:
|
||||
- path: .env
|
||||
required: false
|
||||
volumes:
|
||||
- ../proxy/Caddyfile:/etc/caddy/Caddyfile:ro
|
||||
- caddy-data:/data
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue