-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (47 loc) · 1.51 KB
/
Copy pathdocker-compose.yml
File metadata and controls
51 lines (47 loc) · 1.51 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
version: '3.8'
services:
postgres:
image: postgres:15-alpine
environment:
POSTGRES_DB: adventure
POSTGRES_USER: adventure
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "5433:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U adventure" ]
interval: 10s
timeout: 5s
retries: 5
web:
build: .
ports:
- "5001:5000"
environment:
- DATABASE_URL=postgresql://adventure:${POSTGRES_PASSWORD:-changeme}@postgres:5432/adventure
- SECRET_KEY=${SECRET_KEY:-dev-secret-key-change-in-production}
- FLASK_ENV=production
# Local compose serves plain HTTP on localhost:5001; set to 1 when
# fronted by TLS (the app defaults Secure cookies ON in production).
- SESSION_COOKIE_SECURE=${SESSION_COOKIE_SECURE:-0}
volumes:
- ./instance:/app/instance
- ./logs:/app/logs
depends_on:
postgres:
condition: service_healthy
# NOTE: >1 worker requires sticky sessions + a Socket.IO message queue; state is in-process (pre-existing)
command: [ "gunicorn", "--bind", "0.0.0.0:5000", "--workers", "4", "--worker-class", "geventwebsocket.gunicorn.workers.GeventWebSocketWorker", "--timeout", "120", "app:app" ]
# Development database viewer (optional)
adminer:
image: adminer:latest
ports:
- "8081:8080"
depends_on:
- postgres
environment:
ADMINER_DEFAULT_SERVER: postgres
volumes:
postgres_data: