-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-swarm.yml
85 lines (79 loc) · 1.72 KB
/
docker-swarm.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
version: "3.8"
services:
webserver:
image: lombord/winichat-webserver
deploy:
mode: replicated
replicas: 1
update_config:
order: start-first
depends_on:
- django
environment:
- DJ_HOST=${DJ_HOST}
- DJ_PORT=${DJ_PORT}
- DJ_MAX_BODY_SIZE=${DJ_MAX_BODY_SIZE}
- WEB_DOMAIN=${WEB_DOMAIN}
volumes:
- "static-data:/vol/web"
- /etc/letsencrypt/ssl/fullchain.pem:/etc/nginx/ssl/fullchain.pem
- /etc/letsencrypt/ssl/privkey.pem:/etc/nginx/ssl/privkey.pem
ports:
- "80:8080"
- "443:443"
networks:
- frontend
init: true
stop_grace_period: 1.5s
django:
image: lombord/winichat-api
deploy:
mode: replicated
replicas: 1
update_config:
order: start-first
env_file:
- .env
volumes:
- "static-data:/vol/web"
networks:
- backend
- frontend
depends_on:
- postgresdb
- redis-channels
expose:
- 8000
init: true
redis-channels:
image: redis:7.2.4-alpine3.19
expose:
- 6379
networks:
- backend
init: true
postgresdb:
image: postgres:13.14-alpine3.19
volumes:
- pgdata:/var/lib/postgresql/data
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASS}
- POSTGRES_DB=${DB_NAME}
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U ${DB_USER} -d ${DB_NAME}'"]
interval: 30s
timeout: 10s
retries: 5
start_period: 10s
networks:
- backend
expose:
- 5432
init: true
volumes:
pgdata:
static-data:
networks:
backend:
frontend: