-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
130 lines (119 loc) · 2.74 KB
/
Copy pathdocker-compose.yml
File metadata and controls
130 lines (119 loc) · 2.74 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
version: "3.8"
services:
db:
image: postgres:15-alpine
restart: always
command: ["postgres", "-c", "max_connections=200", "-c", "shared_buffers=128MB"]
environment:
POSTGRES_USER: ${POSTGRES_USER:-app}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set}
POSTGRES_DB: ${POSTGRES_DB:-twin_grid}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U app -d twin_grid"]
interval: 5s
timeout: 5s
retries: 5
# ports:
# - "5433:5432"
redis:
image: redis:7-alpine
restart: always
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
# ports:
# - "6379:6379"
mailpit:
image: axllent/mailpit:latest
restart: always
ports:
- "127.0.0.1:8025:8025"
# - "1025:1025"
environment:
MP_MAX_MESSAGES: 500
backend:
build:
context: ./backend
restart: always
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
env_file: .env
volumes:
- ./backend:/app
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- "127.0.0.1:8000:8000"
command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]
worker:
build:
context: ./backend
restart: always
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
env_file: .env
volumes:
- ./backend:/app
command: ["celery", "-A", "app.core.celery_app", "worker", "--loglevel=info"]
scheduler:
build:
context: ./backend
restart: always
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
env_file: .env
volumes:
- ./backend:/app
command: ["celery", "-A", "app.core.celery_app", "beat", "--loglevel=info", "-s", "/tmp/celerybeat-schedule"]
ws_manager:
build:
context: ./backend
restart: always
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
env_file: .env
volumes:
- ./backend:/app
command: ["python", "-m", "app.ws_runner"]
frontend:
build:
context: ./frontend
restart: always
env_file: .env
# ports:
# - "3000:3000"
caddy:
image: caddy:2-alpine
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ./Caddyfile:/etc/caddy/Caddyfile
- caddy_data:/data
- caddy_config:/config
depends_on:
- frontend
- backend
volumes:
postgres_data:
redis_data:
caddy_data:
caddy_config: