-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
138 lines (131 loc) · 3.65 KB
/
Copy pathdocker-compose.yml
File metadata and controls
138 lines (131 loc) · 3.65 KB
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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
services:
cowrite_api_db:
image: postgres:18-alpine
container_name: cowrite_api_db
restart: always
volumes:
- cowrite_api_db:/var/lib/postgresql
environment:
- POSTGRES_DB=cowrite
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready -p 5432 -U postgres -d cowrite"]
retries: 5
timeout: 10s
interval: 30s
start_period: 30s
start_interval: 5s
cowrite_test_db:
image: postgres:18-alpine
container_name: cowrite_test_db
restart: always
volumes:
- cowrite_test_db:/var/lib/postgresql
environment:
- POSTGRES_DB=cowrite
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
ports:
- 5433:5433
healthcheck:
test: ["CMD-SHELL", "pg_isready -p 5433 -U postgres -d cowrite"]
retries: 5
timeout: 10s
interval: 30s
start_period: 30s
start_interval: 5s
cowrite_redis:
image: redis:8-alpine
container_name: cowrite_redis
restart: always
volumes:
- cowrite_redis:/var/lib/redis
ports:
- 6379:6379
healthcheck:
test: ["CMD-SHELL", "redis-cli ping"]
retries: 5
timeout: 10s
interval: 30s
start_period: 30s
start_interval: 5s
cowrite_broker:
image: rabbitmq:4.0-management-alpine
container_name: cowrite_broker
restart: always
volumes:
- cowrite_broker:/var/lib/rabbitmq
environment:
- RABBITMQ_DEFUALT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
- RABBITMQ_DEFAULT_VHOST=vhost
ports:
- 5672:5672
- 15672:15672
healthcheck:
test: ["CMD-SHELL", "rabbitmq-diagnostics -q check_running"]
retries: 5
timeout: 10s
interval: 30s
start_period: 30s
start_interval: 5s
cowrite_worker:
build:
context: .
dockerfile: Dockerfile
env_file: .env
container_name: cowrite_worker
restart: always
volumes:
- .:/Cowrite
- /Cowrite/.venv
environment:
- REDIS_URL=redis://cowrite_redis:6379/0
- BROKER_URL=amqp://guest:guest@cowrite_broker:5672/vhost
- ASYNC_DB_URL=postgresql+asyncpg://postgres:postgres@cowrite_api_db:5432/cowrite
- SYNC_DB_URL=postgresql+psycopg2://postgres:postgres@cowrite_api_db:5432/cowrite
- ASYNC_TEST_DB_URL=postgresql+asyncpg://postgres:postgres@cowrite_test_db:5432/test_db
command:
["uv", "run", "celery", "-A", "app.worker.celery_app", "worker", "-P", "gevent", "-l", "info"]
depends_on:
cowrite_api_db:
condition: service_healthy
cowrite_redis:
condition: service_healthy
cowrite_broker:
condition: service_healthy
cowrite_api:
build:
context: .
dockerfile: Dockerfile
env_file: .env
container_name: cowrite_api
restart: always
volumes:
- .:/Cowrite
- /Cowrite/.venv
- pytest_cache:/Cowrite/.pytest_cache
environment:
- REDIS_URL=redis://cowrite_redis:6379/0
- BROKER_URL=amqp://guest:guest@cowrite_broker:5672/vhost
- ASYNC_DB_URL=postgresql+asyncpg://postgres:postgres@cowrite_api_db:5432/cowrite
- SYNC_DB_URL=postgresql+psycopg2://postgres:postgres@cowrite_api_db:5432/cowrite
- ASYNC_TEST_DB_URL=postgresql+asyncpg://postgres:postgres@cowrite_test_db:5432/test_db
ports:
- 8000:8000
depends_on:
cowrite_api_db:
condition: service_healthy
cowrite_redis:
condition: service_healthy
cowrite_broker:
condition: service_healthy
volumes:
cowrite_api_db:
cowrite_test_db:
cowrite_redis:
cowrite_broker:
pytest_cache: