-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
106 lines (101 loc) · 2.86 KB
/
docker-compose.yml
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
version: "3.7"
services:
api:
container_name: api.filmin
hostname: api.filmin
build:
context: .
dockerfile: Dockerfile
args:
POETRY_DEV: ${POETRY_DEV:-true}
WAIT_BIN: ${WAIT_BIN:-wait}
env_file:
- env-api-dev
environment:
DEBUGPY: ${DEBUGPY:-true}
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD:-postgres}@${DB_HOST:-postgres}:5432/${POSTGRES_DB:-filmin}
WAIT_HOSTS: postgres:5432,postgres-test:5432,redis:6379
WAIT_LOGGER_LEVEL: error
WAIT_TIMEOUT: 60
WAIT_SLEEP_INTERVAL: 5
PYDEVD_DISABLE_FILE_VALIDATION: 1
REDIS_URL: ${REDIS_URL-redis://redis:6379/0}
REDIS_USER: ${REDIS_USER-default}
REDIS_PASSWORD: ${REDIS_PASSWORD-redis}
depends_on:
- postgres
- postgres-test
- redis
volumes:
- ./src/:/app:cached
ports:
- 8000:80
- 5678:5678 # debupy for webapp
- 5679:5679 # debupy for console
command:
- /bin/sh
- -c
- |
/wait && bash -c \
'if [ "${DEBUGPY}" == "true" ]; then \
python -m debugpy --listen 0.0.0.0:5678 \
-m uvicorn app.asgi:app --host 0.0.0.0 --port 80 \
--reload --reload-dir /app --log-config logging.dev.yaml; \
else \
python -m uvicorn app.asgi:app --host 0.0.0.0 --port 80 \
--reload --reload-dir /app --log-config logging.dev.yaml; \
fi'
restart: on-failure
postgres:
container_name: postgres.filmin
hostname: postgres.filmin
image: postgres:15.3
environment:
POSTGRES_DB: ${POSTGRES_DB-filmin}
POSTGRES_USER: ${POSTGRES_USER-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD-p1234}
PGPASSWORD: ${PGPASSWORD-postgres}
PGUSER: ${PGUSER-postgres}
PHOST: localhost
command:
[
"postgres",
"-c",
"max_connections=1000",
"-c",
"log_statement=all",
"-c",
"log_destination=stderr",
]
ports:
- 5432:5432
volumes:
- postgres_data:/var/lib/postgresql/data:delegated
postgres-test:
container_name: postgres_test.filmin
hostname: postgres-test.filmin
image: postgres:15.3
environment:
POSTGRES_DB: ${POSTGRES_DB-filmin}
POSTGRES_USER: ${POSTGRES_USER-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD-p1234}
PGPASSWORD: ${PGPASSWORD-postgres}
PGUSER: ${PGUSER-postgres}
PHOST: localhost
volumes:
- postgres_test_data:/var/lib/postgresql/data:delegated
redis:
container_name: redis.filmin
image: redis:latest
environment:
REDIS_PASSWORD: ${REDIS_PASSWORD-redis}
command:
- /bin/sh
- -c
- redis-server --appendonly yes --requirepass $$REDIS_PASSWORD
volumes:
- redis_data:/data:delegated
volumes:
postgres_data:
postgres_test_data:
redis_data: