forked from elastic/opbeans-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose_two_containers.yml
148 lines (141 loc) · 4.67 KB
/
docker-compose_two_containers.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
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
version: '2.1'
services:
opbeans-php-backend:
build:
context: .
dockerfile: Dockerfile-backend
container_name: ${OPBEANS_PHP_BACKEND_CONTAINER_NAME:-opbeans-php-backend}
environment:
- ELASTIC_APM_SERVER_URL=${ELASTIC_APM_SERVER_URL:-http://apm-server:8200}
- ELASTIC_APM_SERVICE_NAME=${ELASTIC_APM_SERVICE_NAME:-opbeans-php}
- ELASTIC_APM_ENVIRONMENT=${ELASTIC_APM_ENVIRONMENT:-demo}
- ELASTIC_APM_LOG_LEVEL
- ELASTIC_APM_JS_SERVER_URL=${ELASTIC_APM_JS_SERVER_URL:-http://localhost:8200}
- ELASTIC_APM_JS_SERVICE_NAME=${ELASTIC_APM_JS_SERVICE_NAME:-opbeans-react}
- ELASTIC_APM_JS_SERVICE_VERSION
- DB_HOST=${DB_HOST:-opbeans-php-db-mysql}
- DB_PORT=${DB_PORT:-3306}
- DB_CONNECTION=${DB_CONNECTION:-mysql}
- DB_DATABASE=opbeans_php_db_database
- DB_USERNAME=${DB_USERNAME:-root}
- DB_PASSWORD=opbeans_php_db_password
- OPBEANS_DT_PROBABILITY
- OPBEANS_SERVICES
depends_on:
opbeans-php-db-mysql:
condition: service_healthy
apm-server:
condition: service_healthy
opbeans-php:
build:
context: .
dockerfile: Dockerfile-frontend
container_name: ${OPBEANS_PHP_CONTAINER_NAME:-opbeans-php}
ports:
- "${OPBEANS_PHP_HOST:-127.0.0.1}:${OPBEANS_PHP_PORT:-8000}:80"
depends_on:
- opbeans-php-backend
healthcheck:
test: ["CMD", "curl", "--write-out", "'HTTP %{http_code}'", "--silent", "--output", "/dev/null", "http://localhost:80/"]
retries: 10
interval: 10s
opbeans-php-db-mysql:
image: mysql:8.0
restart: always
environment:
- MYSQL_DATABASE=opbeans_php_db_database
- MYSQL_ROOT_PASSWORD=opbeans_php_db_password
command: mysqld --character-set-server=utf8 --collation-server=utf8_unicode_ci
healthcheck:
test: [ "CMD", "mysqladmin", "--host=localhost" ,"ping" ]
timeout: 20s
retries: 10
apm-server:
image: docker.elastic.co/apm/apm-server:${STACK_VERSION:-7.17.4}
ports:
- "${APM_SERVER_HOST:-127.0.0.1}:${APM_SERVER_PORT:-8200}:8200"
- "${APM_SERVER_MONITOR_HOST:-127.0.0.1}:${APM_SERVER_MONITOR_PORT:-6060}:6060"
command: >
apm-server -e
-E apm-server.frontend.enabled=true
-E apm-server.frontend.rate_limit=100000
-E apm-server.host=0.0.0.0:8200
-E apm-server.read_timeout=1m
-E apm-server.shutdown_timeout=2m
-E apm-server.write_timeout=1m
-E apm-server.rum.enabled=true
-E setup.kibana.host=kibana:5601
-E setup.template.settings.index.number_of_replicas=0
-E xpack.monitoring.elasticsearch=true
-E output.elasticsearch.enabled=${APM_SERVER_ELASTICSEARCH_OUTPUT_ENABLED:-true}
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_OVERRIDE
- SETGID
- SETUID
logging:
driver: 'json-file'
options:
max-size: '2m'
max-file: '5'
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "--write-out", "'HTTP %{http_code}'", "--silent", "--output", "/dev/null", "http://apm-server:8200/"]
retries: 10
interval: 10s
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:${STACK_VERSION:-7.17.4}
environment:
- cluster.name=docker-cluster
- xpack.security.enabled=false
- bootstrap.memory_lock=true
- network.host=0.0.0.0
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms1g -Xmx1g"
- "path.data=/usr/share/elasticsearch/data/${STACK_VERSION:-7.17.4}"
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 2g
logging:
driver: 'json-file'
options:
max-size: '2m'
max-file: '5'
ports:
- "127.0.0.1:${ELASTICSEARCH_PORT:-9200}:9200"
healthcheck:
test: ["CMD-SHELL", "curl -s http://localhost:9200/_cluster/health | grep -vq '\"status\":\"red\"'"]
retries: 10
interval: 20s
kibana:
image: docker.elastic.co/kibana/kibana:${STACK_VERSION:-7.17.4}
environment:
SERVER_NAME: kibana.example.org
ELASTICSEARCH_URL: http://elasticsearch:9200
ports:
- "${KIBANA_HOST:-127.0.0.1}:${KIBANA_PORT:-5601}:5601"
logging:
driver: 'json-file'
options:
max-size: '2m'
max-file: '5'
healthcheck:
test: ["CMD", "curl", "--write-out", "'HTTP %{http_code}'", "--silent", "--output", "/dev/null", "http://kibana:5601/"]
retries: 10
interval: 10s
depends_on:
elasticsearch:
condition: service_healthy
wait:
image: busybox
depends_on:
opbeans-php:
condition: service_healthy