-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
149 lines (138 loc) · 4.6 KB
/
docker-compose.yaml
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
services:
# targets: test or production
fastapi-app:
container_name: fastapi-app
# build:
# target: production
image: harbor.stfc.ac.uk/dseg/api:main #will pull the prod image from harbor instead of building it from local code
depends_on:
icat_mariadb:
condition: service_healthy
testdata:
condition: service_completed_successfully
ports:
- "8000:8000"
###############################################################
# The following services are part of the ELK stack #
###############################################################
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.10.2
container_name: elasticsearch
environment:
discovery.type: single-node
xpack.security.enabled: false
ports:
- "9200:9200"
- "9300:9300"
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9200" ]
interval: 10s
timeout: 5s
retries: 5
# Kibana for visualization
kibana:
image: docker.elastic.co/kibana/kibana:8.10.2
container_name: kibana
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
ports:
- "5601:5601"
depends_on:
elasticsearch:
condition: service_healthy
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:5601" ]
interval: 10s
timeout: 5s
retries: 5
filebeat:
image: docker.elastic.co/beats/filebeat:8.10.2
user: root
volumes:
- ./dependency_config/filebeat.yml:/usr/share/filebeat/filebeat.yml:ro
- /var/lib/docker/containers:/var/lib/docker/containers:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
command: filebeat -e -strict.perms=false
restart: unless-stopped
metricbeat:
image: docker.elastic.co/beats/metricbeat:8.10.2
container_name: metricbeat
user: root
volumes:
- ./dependency_config/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
environment:
- ELASTICSEARCH_HOSTS=http://elasticsearch:9200
depends_on:
- elasticsearch
command: [ "--strict.perms=false" ]
###############################################################
# The following services are part of the ICAT stack #
###############################################################
# Database needed to store the test data
icat_mariadb:
restart: always
# note: the latest version does not support the SQL connector needed by icat
image: mariadb:10.10
container_name: icat_mariadb_container
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: pw
MARIADB_DATABASE: icatdb
MARIADB_USER: icatdbuser
MARIADB_PASSWORD: icatdbuserpw
# the health check will tell us when data is in the DB
healthcheck:
test: |
/usr/bin/mysql --user=$$MARIADB_USER \
--password=$$MARIADB_PASSWORD \
--execute "select * from icatdb.DATAFILEPARAMETER;"
interval: 10s
timeout: 2s
retries: 10
# The ICAT server, available at http://localhost:18181/icat/version
# The data can be browsed by using the icat-admin user interface at
# https://icatadmin.netlify.app/
# remember to go to version endpoint first and accept cert
icat_payara:
restart: always
image: harbor.stfc.ac.uk/icat/icat_5:latest
container_name: icat_payara_container
ports:
- "14747:4848" # payara port
- "18181:8181" # https port
volumes:
- type: bind
source: ./dependency_config/icat-post-boot-commands.asadmin
target: /config/post-boot-commands.asadmin
environment:
- POSTBOOT_COMMANDS=/config/post-boot-commands.asadmin
healthcheck:
test: curl --fail http://localhost:8080/icat/version || exit 1
interval: 10s
timeout: 2s
retries: 10
# The Auth service needed by ICAT,
# Available at https://localhost:28181/authn.simple/version/
auth_payara:
restart: unless-stopped
image: harbor.stfc.ac.uk/icat/icat_auth:latest
container_name: auth_payara_container
ports:
- "24747:4848"
- "28181:8181"
healthcheck:
test: curl --fail -k https://localhost:8181/authn.simple/version || exit 1
interval: 10s
timeout: 2s
retries: 10
# Fills up the icat db with a set of auto generated / known test data
# Based on script: https://github.com/ral-facilities/
# datagateway-api/blob/v6.2.0/util/icat_db_generator.py
testdata:
image: harbor.stfc.ac.uk/icat/icat_testdata:latest
container_name: testdata_container
depends_on:
icat_mariadb:
condition: service_healthy