-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathdocker-compose.yml
82 lines (77 loc) · 2.02 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
services:
redis:
container_name: redis
image: 'redis:7-alpine'
user: "1000"
command: redis-server --requirepass ${REDIS_PASSWORD:-verystrongpass}
volumes:
- 'redis-data:/data'
ports:
- '6379:6379'
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 3
website:
container_name: website
build: .
user: "1000"
volumes:
- '.:/app'
depends_on:
- redis
ports:
- '8000:5000'
environment:
- FLASK_APP=run.py
- FLASK_DEBUG=0
- SQLALCHEMY_DATABASE_URI=postgresql://enferno:${DB_PASSWORD:-verystrongpass}@postgres/enferno
- CELERY_BROKER_URL=redis://:${REDIS_PASSWORD:-verystrongpass}@redis:6379/2
- CELERY_RESULT_BACKEND=redis://:${REDIS_PASSWORD:-verystrongpass}@redis:6379/3
- SESSION_REDIS=redis://:${REDIS_PASSWORD:-verystrongpass}@redis:6379/1
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:5000/health"]
interval: 30s
timeout: 10s
retries: 3
nginx:
container_name: nginx
restart: always
image: 'nginx:alpine'
user: "1000"
ports:
- '80:80'
volumes:
- './enferno/static/:/app/static/:ro'
- './nginx/nginx.conf:/etc/nginx/nginx.conf:ro'
- './nginx/enferno.conf:/etc/nginx/conf.d/default.conf:ro'
tmpfs:
- /tmp:exec,mode=1777
- /var/run:mode=1777
- /var/cache/nginx:mode=1777
depends_on:
- website
healthcheck:
test: [ "CMD", "service", "nginx", "status" ]
celery:
container_name: celery
build: .
user: "1000"
command: celery -A enferno.tasks worker -l info
volumes:
- '.:/app'
depends_on:
- redis
environment:
- FLASK_APP=run.py
- CELERY_BROKER_URL=redis://:${REDIS_PASSWORD:-verystrongpass}@redis:6379/2
- CELERY_RESULT_BACKEND=redis://:${REDIS_PASSWORD:-verystrongpass}@redis:6379/3
volumes:
redis-data:
driver: local
enferno:
nginx_tmp:
driver: local
nginx_run:
driver: local