forked from codingwithmax/PythonTutorialFastAPI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
61 lines (54 loc) · 1.19 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
version: "3"
services:
app:
build:
context: ""
args:
- ENVIRONMENT=local
ports:
- "8080:8080"
entrypoint: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080", "--reload"]
volumes:
- ./app:/usr/src/app
- ./models:/usr/src/models
environment:
- db_postgres_host=postgresql://postgres:postgres@postgresdb:5432/postgres
- db_redis_host=redis://redis
depends_on:
- postgresdb
- redis
app-test:
build:
context: ""
args:
- ENVIRONMENT=test
volumes:
- .:/usr/src
entrypoint: ["sleep", "infinity"]
environment:
- db_postgres_host=postgresql://postgres:postgres@testingdb:5432/postgres
- app_env=test
- db_redis_host=redis://redistestdb
depends_on:
- testingdb
- redistestdb
postgresdb:
image: postgres:14.1-alpine
ports:
- "5432:5432"
env_file:
- .env-local
volumes:
- pgdb:/var/lib/postgresql/data
testingdb:
image: postgres:14.1-alpine
env_file:
- .env-local
redis:
image: redis:6.2-alpine
ports:
- "6379:6379"
redistestdb:
image: redis:6.2-alpine
volumes:
pgdb: