Skip to content

Commit b999a41

Browse files
committed
Simplify local docker compose and inject env variables only by .env file such that service can be reloaded at runtime if file changes
1 parent dcc309d commit b999a41

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

scripts/local_with_uvicorn/docker-compose.yml

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
services:
22
web:
3-
build:
3+
build:
44
context: .
55
dockerfile: Dockerfile
6-
# -------- Both of the following commands should be commented to run with nginx --------
7-
8-
# -------- replace with comment to run with gunicorn --------
9-
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
10-
# command: gunicorn app.main:app -w 4 -k uvicorn.workers.UvicornWorker -b 0.0.0.0:8000
11-
env_file:
12-
- ./src/.env
13-
# -------- replace with expose if you are using nginx --------
146
ports:
157
- "8000:8000"
16-
# expose:
17-
# - "8000"
188
depends_on:
199
- db
2010
- redis
@@ -23,7 +13,7 @@ services:
2313
- ./src/.env:/code/.env
2414

2515
worker:
26-
build:
16+
build:
2717
context: .
2818
dockerfile: Dockerfile
2919
command: arq app.core.worker.settings.WorkerSettings
@@ -64,7 +54,7 @@ services:
6454

6555
#-------- uncomment to create first superuser --------
6656
create_superuser:
67-
build:
57+
build:
6858
context: .
6959
dockerfile: Dockerfile
7060
env_file:
@@ -78,9 +68,9 @@ services:
7868

7969
#-------- uncomment to run tests --------
8070
pytest:
81-
build:
71+
build:
8272
context: .
83-
dockerfile: Dockerfile
73+
dockerfile: Dockerfile
8474
env_file:
8575
- ./src/.env
8676
depends_on:
@@ -93,7 +83,7 @@ services:
9383

9484
#-------- uncomment to create first tier --------
9585
# create_tier:
96-
# build:
86+
# build:
9787
# context: .
9888
# dockerfile: Dockerfile
9989
# env_file:
@@ -109,4 +99,3 @@ services:
10999
volumes:
110100
postgres-data:
111101
redis-data:
112-

0 commit comments

Comments
 (0)