-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
132 lines (126 loc) · 3.1 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
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
version: "3.8"
services:
db:
image: postgres:15-alpine
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${DB_NAME:-pampdb}
- POSTGRES_USER=${DB_USER:-postgres}
- POSTGRES_PASSWORD=${DB_PASSWORD:-123456}
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${DB_USER:-postgres} -d ${DB_NAME:-pampdb}",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
networks:
- app_network
ports:
- "5432:5432"
web:
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
- static_volume:/app/static
- media_volume:/app/media
- frontend_build:/app/frontend/build
- /app/frontend/node_modules
ports:
- "8000:8000"
- "3000:3000"
environment:
- DEBUG=${DEBUG:-1}
- SECRET_KEY=${SECRET_KEY:-your-secret-key-123}
- DJANGO_ALLOWED_HOSTS=localhost 127.0.0.1 [::1] web web:8000 web:3000
- DB_NAME=${DB_NAME:-pampdb}
- DB_USER=${DB_USER:-postgres}
- DB_PASSWORD=${DB_PASSWORD:-123456}
- DB_HOST=${DB_HOST:-db}
- DB_PORT=${DB_PORT:-5432}
- GOOGLE_OAUTH2_KEY=${GOOGLE_OAUTH2_KEY}
- GOOGLE_OAUTH2_SECRET=${GOOGLE_OAUTH2_SECRET}
- REACT_APP_API_URL=http://localhost:8000/api
- NODE_ENV=development
- SERVICE_NAME=web
- PORT=3000
- WDS_SOCKET_PORT=3000
- CHOKIDAR_USEPOLLING=true
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health/"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
depends_on:
db:
condition: service_healthy
networks:
- app_network
restart: unless-stopped
bot:
build:
context: .
dockerfile: Dockerfile
volumes:
- .:/app
- bot_data:/app/bot_data
entrypoint: /app/bot_entrypoint.sh
environment:
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
- BOT_API_KEY=${BOT_API_KEY}
- API_BASE_URL=http://web:8000
- TIMEZONE=Europe/Lisbon
- CHAT_IDS_FILE=/app/bot_data/chat_ids.json
- PYTHONPATH=/app
- SERVICE_NAME=bot
- HEADERS_HOST=web
depends_on:
web:
condition: service_healthy
networks:
- app_network
restart: unless-stopped
nginx:
image: nginx:1.25-alpine
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- static_volume:/app/static:ro
- media_volume:/app/media:ro
- frontend_build:/app/frontend/build:ro
ports:
- "8080:8080"
environment:
- NGINX_PORT=8080
depends_on:
web:
condition: service_healthy
networks:
- app_network
restart: unless-stopped
healthcheck:
test: ["CMD", "nginx", "-t"]
interval: 30s
timeout: 10s
retries: 3
networks:
app_network:
name: pamp_network
driver: bridge
volumes:
postgres_data:
name: pamp_postgres_data
static_volume:
name: pamp_static_volume
media_volume:
name: pamp_media_volume
frontend_build:
name: pamp_frontend_build
bot_data:
name: pamp_bot_data