Skip to content

Commit

Permalink
[IMP] Set environment variable PGHOST to current service name
Browse files Browse the repository at this point in the history
  • Loading branch information
josep-tecnativa committed Jan 28, 2025
1 parent 7ecf2a1 commit 0ee4957
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions common.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ services:
environment:
POSTGRES_DB: *dbname
POSTGRES_USER: *dbuser
PGHOST: "${DB_HOST:-db}"
CONF_EXTRA: |
work_mem = 512MB
volumes:
Expand Down
2 changes: 2 additions & 0 deletions prod.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ services:
extends:
file: common.yaml
service: db
environment:
- DB_HOST={{ _key }}-db
env_file:
- .docker/db-creation.env
restart: unless-stopped
Expand Down
2 changes: 2 additions & 0 deletions test.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ services:
service: db
env_file:
- .docker/db-creation.env
environment:
- DB_HOST={{ _key }}-db
restart: unless-stopped
{%- endif %}

Expand Down

0 comments on commit 0ee4957

Please sign in to comment.