-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
119 lines (115 loc) · 3.41 KB
/
docker-compose.yml
File metadata and controls
119 lines (115 loc) · 3.41 KB
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
services:
nexus_db:
image: postgres:14
container_name: nexus_db
restart: always
env_file:
- .env.${MINEXUS_ENV:-test}
environment:
- MINEXUS_ENV=${MINEXUS_ENV:-test}
- POSTGRES_USER=${DBUSER}
- POSTGRES_PASSWORD=${DBPASS}
- POSTGRES_DB=${DBNAME}
ports:
- 5432:5432
volumes:
- ./config/docker/initdb:/docker-entrypoint-initdb.d
- nexus_db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DBUSER} -d ${DBNAME}"]
interval: 2s
timeout: 5s
retries: 10
networks:
- default
# Nexus server - depends on database being healthy
nexus:
build:
context: .
dockerfile: Dockerfile.nexus
args:
MINEXUS_ENV: ${MINEXUS_ENV:-test}
container_name: nexus
env_file:
- .env.${MINEXUS_ENV:-test}
restart: always
environment:
- MINEXUS_ENV=${MINEXUS_ENV:-test}
- DEBUG=${DEBUG:-false}
- NEXUS_MINION_PORT=${NEXUS_MINION_PORT:-11972}
- NEXUS_CONSOLE_PORT=${NEXUS_CONSOLE_PORT:-11973}
- NEXUS_WEB_PORT=${NEXUS_WEB_PORT:-8086}
- DBHOST=nexus_db
- DBPORT=${DBPORT:-5432}
- DBUSER=${DBUSER}
- DBPASS=${DBPASS}
- DBNAME=${DBNAME}
ports:
- "${NEXUS_MINION_PORT:-11972}:${NEXUS_MINION_PORT:-11972}"
- "${NEXUS_CONSOLE_PORT:-11973}:${NEXUS_CONSOLE_PORT:-11973}"
- "${NEXUS_WEB_PORT:-8086}:${NEXUS_WEB_PORT:-8086}"
depends_on:
nexus_db:
condition: service_healthy
networks:
- default
healthcheck:
#test: ["CMD-SHELL", "nc -z nexus ${NEXUS_MINION_PORT:-11972} && nc -z nexus ${NEXUS_CONSOLE_PORT:-11973} && nc -z nexus ${NEXUS_WEB_PORT:-8086} && echo 'All three ports accessible' || exit 1"]
test: ["CMD-SHELL", "nc -z nexus ${NEXUS_MINION_PORT:-11972} && nc -z nexus ${NEXUS_CONSOLE_PORT:-11973} && echo 'All three ports accessible' || exit 1"]
interval: 3s
timeout: 5s
retries: 10
start_period: 11s
# Minion client - depends on nexus server being healthy
minion:
build:
context: .
dockerfile: Dockerfile.minion
args:
MINEXUS_ENV: ${MINEXUS_ENV:-test}
container_name: minion
env_file:
- .env.${MINEXUS_ENV:-test}
restart: always
environment:
- MINEXUS_ENV=${MINEXUS_ENV:-test}
- DEBUG=true
- MINION_ID=${MINION_ID:-docker-minion}
- NEXUS_SERVER=nexus
- NEXUS_MINION_PORT=${NEXUS_MINION_PORT:-11972}
- HEARTBEAT_INTERVAL=${HEARTBEAT_INTERVAL:-60}
- INITIAL_RECONNECT_DELAY=${INITIAL_RECONNECT_DELAY:-1}
- MAX_RECONNECT_DELAY=${MAX_RECONNECT_DELAY:-3600}
- CONNECT_TIMEOUT=${CONNECT_TIMEOUT:-3}
depends_on:
nexus:
condition: service_healthy
networks:
- default
# Console client - depends on nexus server being healthy
console:
build:
context: .
dockerfile: Dockerfile.console
args:
MINEXUS_ENV: ${MINEXUS_ENV:-test}
container_name: minexus_console
env_file:
- .env.${MINEXUS_ENV:-test}
environment:
- MINEXUS_ENV=${MINEXUS_ENV:-test}
- DEBUG=${DEBUG:-false}
- NEXUS_SERVER=nexus
- NEXUS_CONSOLE_PORT=${NEXUS_CONSOLE_PORT:-11973}
- CONNECT_TIMEOUT=${CONNECT_TIMEOUT:-3}
depends_on:
nexus:
condition: service_healthy
networks:
- default
stdin_open: true
tty: true
profiles:
- console
volumes:
nexus_db_data: