Skip to content

Commit 6af361f

Browse files
committed
Fix more local native vs container running issues
1 parent ad74568 commit 6af361f

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

template/{{app_name}}/docker-compose.yml.jinja

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,19 @@ services:
2727
- path: ./override.env
2828
required: false
2929
environment:
30+
# IMPORTANT NOTE
31+
#
32+
# Only env vars needing tweaked specifically for the container runtime
33+
# environment should be defined here.
34+
#
35+
# Add general local configuration things to local.env
36+
37+
# Settings for running make inside the container
38+
- PY_RUN_APPROACH=local
3039
- PYTHONPATH=/app/
40+
41+
# Point to other containers via the internal network
42+
- DB_HOST={{ app_name }}-db
3143
ports:
3244
- {{ app_local_port }}:{{ app_local_port }}
3345
volumes:

template/{{app_name}}/local.env.jinja

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ API_AUTH_TOKEN=LOCAL_AUTH_12345678
4444
# DB Environment Variables
4545
############################
4646

47-
# Set DB_HOST to localhost if accessing a non-dockerized database
48-
DB_HOST={{ app_name }}-db
47+
# Set default for DB_HOST which supports running natively. DB_HOST is overridden
48+
# in docker-compose.yml when running via the container.
49+
DB_HOST=localhost
4950
DB_NAME=app
5051
DB_USER=app
5152
DB_SCHEMA=public

0 commit comments

Comments
 (0)