-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
94 lines (88 loc) · 2.19 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
services:
web:
build: .
ports:
- '5000:5000'
environment:
SECRET_KEY: ${SECRET_KEY}
MAIL_SERVER: ${MAIL_SERVER}
MAIL_PORT: ${MAIL_PORT}
MAIL_USE_TLS: ${MAIL_USE_TLS}
MAIL_USERNAME: ${MAIL_USERNAME}
MAIL_PASSWORD: ${MAIL_PASSWORD}
MAIL_FROM: ${MAIL_FROM}
ADMINS: ${ADMINS}
DATABASE_URL: mysql+pymysql://microblog:${MYSQL_PASSWORD}@db/microblog
ELASTICSEARCH_URL: http://es:9200
REDIS_URL: redis://redis:6379/0
networks:
- microblog-network
depends_on:
db:
condition: service_healthy
db:
image: mysql:latest
ports:
- '3306:3306'
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 'yes'
MYSQL_DATABASE: microblog
MYSQL_USER: microblog
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
networks:
- microblog-network
volumes:
- mysql_data:/var/lib/mysql
healthcheck:
test: ['CMD', 'mysqladmin', 'ping', '-h', 'localhost']
interval: 5s
timeout: 10s
retries: 5
es:
image: docker.elastic.co/elasticsearch/elasticsearch:8.11.1
ports:
- '9200:9200'
environment:
discovery.type: single-node
xpack.security.enabled: false
networks:
- microblog-network
redis:
image: redis:latest
ports:
- '6379:6379'
networks:
- microblog-network
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 5s
retries: 5
rq-worker:
build: .
environment:
SECRET_KEY: ${SECRET_KEY}
MAIL_SERVER: ${MAIL_SERVER}
MAIL_PORT: ${MAIL_PORT}
MAIL_USE_TLS: ${MAIL_USE_TLS}
MAIL_USERNAME: ${MAIL_USERNAME}
MAIL_PASSWORD: ${MAIL_PASSWORD}
MAIL_FROM: ${MAIL_FROM}
ADMINS: ${ADMINS}
DATABASE_URL: mysql+pymysql://microblog:${MYSQL_PASSWORD}@db/microblog
ELASTICSEARCH_URL: http://es:9200
REDIS_URL: redis://redis:6379/0
networks:
- microblog-network
entrypoint: rq
command: worker -u redis://redis:6379/0 microblog-tasks
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
networks:
microblog-network:
driver: bridge
volumes:
mysql_data: