This repository has been archived by the owner on Jan 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.deployment.neo4j.yml
55 lines (52 loc) · 2.19 KB
/
docker-compose.deployment.neo4j.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
version: '3.7'
# https://docs.docker.com/compose/compose-file/compose-file-v3/
services:
ontology-neo4j:
hostname: ontology-neo4j
container_name: ontology-neo4j
# Will not publish the neo4j image to DockerHub
build: neo4j
environment:
- NEO4J_USER=${NEO4J_USER:-neo4j}
# Used for setting the initial neo4j password, defaut to HappyG0at
- NEO4J_PASSWORD=${NEO4J_PASSWORD:-HappyG0at}
# Allow the JVM to read cgroup limits
# -XX:+UseContainerSupport is enabled by default on linux machines,
# this feature was introduced in java10 then backported to Java-8u191, the base image comes with OpenJDK(build 1.8.0_232-b09)
# -XX:MaxRAMPercentage (double) is depending on the max memory limit assigned to the contaienr
# When the container has > 1G memory, set -XX:MaxRAMPercentage=75.0 is good (doesn't waste too many resources)
- _JAVA_OPTIONS=-XX:+UseContainerSupport -XX:MaxRAMPercentage=75.0
# Avoid accidentally creating zombie processes
init: true
# Specifying a restart policy to avoid downtime
restart: always
ports:
- 7477:7474
- 7688:7687
healthcheck:
# https://docs.docker.com/engine/reference/builder/#healthcheck
test: ["CMD", "curl", "--fail", "http://localhost:7474/"]
# test: curl --fail -s http://localhost:7474/ || exit 1
# test: perl -MIO::Socket::INET -e 'exit(! defined( IO::Socket::INET->new("localhost:7687")))'
interval: 10s
timeout: 10s
retries: 10
volumes:
# Logging mount
- "./neo4j/logs:/usr/src/app/neo4j/logs"
# Data mount using named voulme
- ontology-neo4j-data:/usr/src/app/neo4j/data
# By default this `deploy` key only takes effect when deploying to a swarm with docker stack deploy, and is ignored by docker-compose up
# However, we can use the `--compatibility` flag within `docker-compose --compatibility up`
# The `--compatibility` flag will attempt to convert deploy keys in docker-compose v3 to their non-Swarm equivalent
deploy:
resources:
limits:
memory: 8G
networks:
- ontology-neo4j-network
# Named volume
volumes:
ontology-neo4j-data:
networks:
ontology-neo4j-network: