This repository has been archived by the owner on Aug 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocker-compose.yml
162 lines (153 loc) · 4.16 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
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
156
157
158
159
160
161
162
---
version: '2.2'
services:
apm-server:
image: docker.elastic.co/apm/apm-server:7.15.1
depends_on:
elasticsearch:
condition: service_healthy
kibana:
condition: service_healthy
cap_add: ["CHOWN", "DAC_OVERRIDE", "SETGID", "SETUID"]
cap_drop: ["ALL"]
ports:
- 8200:8200
command: >
apm-server -e
-E apm-server.rum.enabled=true
-E setup.kibana.host=kibana:5601
-E setup.template.settings.index.number_of_replicas=0
-E apm-server.kibana.enabled=true
-E apm-server.kibana.host=kibana:5601
-E output.elasticsearch.hosts=["elasticsearch:9200"]
healthcheck:
interval: 10s
retries: 12
test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:8200/
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:7.15.1
environment:
- bootstrap.memory_lock=true
- cluster.name=docker-cluster
- cluster.routing.allocation.disk.threshold_enabled=false
- discovery.type=single-node
- ES_JAVA_OPTS=-XX:UseAVX=2 -Xms1g -Xmx1g
ulimits:
memlock:
hard: -1
soft: -1
volumes:
- esdata:/usr/share/elasticsearch/data
ports:
- 9200:9200
healthcheck:
interval: 20s
retries: 10
test: curl -s http://localhost:9200/_cluster/health | grep -vq '"status":"red"'
kibana:
image: docker.elastic.co/kibana/kibana:7.15.1
depends_on:
elasticsearch:
condition: service_healthy
environment:
ELASTICSEARCH_URL: http://elasticsearch:9200
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
ports:
- 5601:5601
healthcheck:
interval: 10s
retries: 20
test: curl --write-out 'HTTP %{http_code}' --fail --silent --output /dev/null http://localhost:5601/api/status
ocaml-base:
image: ocaml-base:latest
build:
context: .
dockerfile: ocaml-base.Dockerfile
reverse-string-example:
image: reverse-string-ocaml
build:
context: .
dockerfile: example/1-hello-opium/Dockerfile
environment:
port: 4000
ELASTIC_APM_SERVER_URL: "http://apm-server:8200"
ELASTIC_APM_SECRET_TOKEN: ""
expose:
- 4000
ports:
- 4000:4000
depends_on:
apm-server:
condition: service_healthy
polyglot-example-ocaml:
image: polyglot-example-ocaml
build:
context: .
dockerfile: example/3-polyglot-services/ocaml/Dockerfile
environment:
port: 4001
ELASTIC_APM_SERVER_URL: "http://apm-server:8200"
ELASTIC_APM_SECRET_TOKEN: ""
UPSTREAM_SERVICE: "http://polyglot-example-python:5000"
expose:
- 4001
ports:
- 4001:4001
depends_on:
apm-server:
condition: service_healthy
polyglot-example-python:
image: polyglot-example-python
build:
context: .
dockerfile: example/3-polyglot-services/python/Dockerfile
environment:
ELASTIC_APM_SERVICE_NAME: "python-ping-pong"
ELASTIC_APM_SERVER_URL: "http://apm-server:8200"
ELASTIC_APM_SECRET_TOKEN: ""
DOWNSTREAM_SERVICE: "http://polyglot-example-ocaml:4001"
expose:
- 5000
ports:
- 5000:5000
depends_on:
apm-server:
condition: service_healthy
test-postgres:
image: postgres
container_name: test-postgres
environment:
- POSTGRES_USER=ocaml_demo
- POSTGRES_DB=ocaml_demo
- POSTGRES_HOST_AUTH_METHOD=trust
ports:
- 5432:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
volumes:
- ./postgres_init.sql:/docker-entrypoint-initdb.d/postgres_init.sql
database-example-ocaml:
image: database-example-ocaml
build:
context: .
dockerfile: example/2-database-ocaml/Dockerfile
environment:
port: 4003
ELASTIC_APM_SERVER_URL: "http://apm-server:8200"
ELASTIC_APM_SECRET_TOKEN: ""
PG_HOST: "test-postgres"
expose:
- 4003
ports:
- 4003:4003
depends_on:
apm-server:
condition: service_healthy
test-postgres:
condition: service_healthy
volumes:
esdata:
driver: local