-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsample_docker-compose.yml
75 lines (74 loc) · 2.47 KB
/
sample_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
# docker-compose -f sample_docker-compose.yml up --detach --build
version: '3'
services:
# when updating changes to code: "docker-compose -f sample_docker-compose.yml up --detach --build nde-hub"
mongodb:
image: mongo:5.0
ports:
- "127.0.0.1:27017:27017"
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.6.0
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- xpack.security.http.ssl.enabled=false
- xpack.security.transport.ssl.enabled=false
ports:
- "9200:9200"
# socat is used to expose the docker socket from local to the hub container
# Container has no permission to access local docker socket so we need to create a tcp port to expose it
# https://forums.docker.com/t/mounting-using-var-run-docker-sock-in-a-container-not-running-as-root/34390/7
socat:
image: alpine/socat
# command: tcp-listen:2375,fork,reuseaddr,keepalive=1,keepidle=60,keepintvl=10,keepcnt=3 unix-connect:/var/run/docker.sock
command: tcp4-listen:2375,fork,reuseaddr unix-client:/var/run/docker.sock
user: root
volumes:
- type: bind
source: /var/run/docker.sock
target: /var/run/docker.sock
ports:
- "2375:2375"
nde-hub:
build:
context: biothings-hub
dockerfile: Dockerfile
args:
PYTHON_VERSION: "3.10"
# May need to configure this if you get timeout errors after 2 hours.
# sysctls:
# net.ipv4.tcp_keepalive_intvl: '45'
# net.ipv4.tcp_keepalive_probes: '15'
# net.ipv4.tcp_keepalive_time: '7200'
# privileged: true
depends_on:
- "mongodb"
- "elasticsearch"
- "socat"
extra_hosts:
# If you want to access a port from local machine
- "host.docker.internal:host-gateway"
environment:
- ES_HOST=elasticsearch:9200
# example of using local mongodb over containerized mongodb
# - MONGO_HOST=host.docker.internal:27018
- MONGO_HOST=mongodb:27017
- DOCKER_HOST=socat:2375
volumes:
# Update this to wherever you want VS Code to mount the folder of your project
- data:/data
- cache:/cache
ports:
# ports are mapped to 19522 and 19580 because of changes for production environment
- "127.0.0.1:7022:19522"
- "127.0.0.1:7080:19580"
- "127.0.0.1:7081:19581"
hub-webapp:
build:
context: biothings-webapp
dockerfile: Dockerfile
ports:
- "127.0.0.1:8080:80"
volumes:
data:
cache: