-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
77 lines (71 loc) · 1.59 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
version: '3.8'
services:
nginx:
build: ./nginx
ports:
- 1337:80
depends_on:
- fastapi_app
networks:
- semyon-network
fastapi_app:
build: ./fastapi_app
env_file:
- ./fastapi_app/.env
- ./fastapi_app/.env.redis
volumes:
- storage_volume:/my_project/fastapi_app/storage
depends_on: ["db", "cache", "redis-commander"]
# db:
# condition: service_healthy
# cache:
# redis-commander:
ports:
- 8000:8000
networks:
- semyon-network
command:
- sh
- -c
- |
alembic -c /my_project/fastapi_app/alembic.ini upgrade head
uvicorn fastapi_app.src.main:app --reload --host 0.0.0.0 --port 8000
# gunicorn -w 4 -b 0.0.0.0:8000 fastapi_app.src.main:app
db:
image: postgres:14.0-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env.postgres
ports:
- 5433:5432
healthcheck:
test: [ "CMD", "pg_isready", "-q", "-d", "storage_db", "-U", "storage_user" ]
networks:
- semyon-network
cache:
image: redis:6.2-alpine
restart: always
ports:
- 6379:6379
networks:
- semyon-network
redis-commander:
container_name: redis-commander
hostname: redis-commander
image: ghcr.io/joeferner/redis-commander:latest
restart: always
depends_on:
- cache
environment:
- REDIS_HOSTS=local:cache:6379
ports:
- "8081:8081"
networks:
- semyon-network
volumes:
postgres_data:
storage_volume:
networks:
semyon-network:
driver: bridge