-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcompose.yaml
More file actions
155 lines (150 loc) · 3.77 KB
/
compose.yaml
File metadata and controls
155 lines (150 loc) · 3.77 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
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
x-extra_hosts: &default-extra_hosts
- "openchurch.local:host-gateway"
- "api.openchurch.local:host-gateway"
- "admin.openchurch.local:host-gateway"
services:
db:
image: mariadb:11.5.2
container_name: openchurch_db
command: --default-authentication-plugin=caching_sha2_password
volumes:
- openchurch_db_data:/var/lib/mysql:delegated
ports:
- 3306:3306
environment:
MYSQL_ROOT_PASSWORD: openchurch
MYSQL_DATABASE: openchurch
MYSQL_USER: openchurch
MYSQL_PASSWORD: openchurch
networks:
- app-network
healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u $$MYSQL_USER --password=$$MYSQL_PASSWORD
start_period: 5s
interval: 5s
timeout: 5s
retries: 55
elasticsearch:
container_name: openchurch_elasticsearch
build:
context: .
dockerfile: ./docker/elasticsearch/Dockerfile
environment:
- discovery.type=single-node
- xpack.security.enrollment.enabled=true
- bootstrap.memory_lock=true
- ES_JAVA_OPTS=-Xms512m -Xmx512m # 512mo HEAP
- ELASTIC_PASSWORD=admin
healthcheck:
test: "curl -s -u elastic:$$ELASTIC_PASSWORD -f -X GET localhost:9200/_cluster/health || exit 1"
interval: 10s
timeout: 5s
retries: 30
networks:
- app-network
ports:
- 9200:9200
volumes:
- ./openchurch_elasticsearch_data:/usr/share/elasticsearch/data
backend:
extra_hosts: *default-extra_hosts
container_name: openchurch_backend
build:
context: .
dockerfile: ./docker/php/Dockerfile
volumes:
- .:/var/www/html
- ./usr/local/bin/docker-php-entrypoint:/usr/local/bin/docker-php-entrypoint
ports:
- 443:443
- 2019:2019
depends_on:
- db
- redis
- elasticsearch
user: root
networks:
- app-network
environment:
SERVER_NAME: "localhost api.openchurch.local admin.openchurch.local"
APP_ENV:
REDIS_URI:
DATABASE_URL:
SENTRY_DSN:
MONITORING_SERVER_IP:
HOST_API:
APP_SECRET:
ELASTICSEARCH_IRI:
ELASTIC_PASSWORD:
REDIS_URL:
CORS_ALLOW_ORIGIN:
cli:
extra_hosts: *default-extra_hosts
container_name: openchurch_backend_cli
command: /usr/sbin/cron -f -l 15
build:
context: .
dockerfile: ./docker/php/Dockerfile
environment:
SERVER_NAME: :80
APP_ENV:
DATABASE_URL:
HOST_API:
APP_SECRET:
ELASTICSEARCH_IRI:
ELASTIC_PASSWORD:
SYNCHRO_SECRET_KEY:
REDIS_URL:
depends_on:
- db
- redis
- elasticsearch
user: root
healthcheck:
test: if [ $$(pgrep -F /var/run/crond.pid -r S,R --count) -eq 1 ]; then exit 0; else exit 1; fi
interval: 5s
timeout: 5s
retries: 55
networks:
- app-network
python:
container_name: openchurch_python
command: /usr/sbin/cron -f -l 15
build:
context: .
dockerfile: ./docker/python/Dockerfile
depends_on:
- redis
- backend
networks:
- app-network
extra_hosts:
- "api.openchurch.local:host-gateway"
environment:
OPENCHURCH_HOST: "https://api.openchurch.local/api"
PYTHONWARNINGS: "ignore:Unverified HTTPS request"
SYNCHRO_SECRET_KEY: "secret"
REDIS_URL: redis://redis:6379
SLEEP_MS_BETWEEN_REQUESTS: 1
SENTRY_DSN_SYNCHRO:
volumes:
- ./scripts:/app
redis:
image: redis:5
container_name: openchurch_redis
expose:
- 6379
networks:
- app-network
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 1s
timeout: 5s
retries: 55
start_period: 30s
volumes:
openchurch_db_data: {}
openchurch_elasticsearch_data: {}
networks:
app-network:
driver: bridge