-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.dev.yml
174 lines (166 loc) · 5.61 KB
/
docker-compose.dev.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
163
164
165
166
167
168
169
170
171
172
173
174
# Copyright 2023 Specter Ops, Inc.
#
# Licensed under the Apache License, Version 2.0
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# SPDX-License-Identifier: Apache-2.0
services:
proxy:
image: docker.io/library/traefik:latest
command:
- --api.insecure=true
- --providers.docker
- --providers.docker.exposedbydefault=false
ports:
- ${WEB_PORT:-127.0.0.1:80}:80
- ${TRAEFIK_PORT:-127.0.0.1:8000}:8080
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
app-db:
image: docker.io/library/postgres:13.2
environment:
- POSTGRES_USER=${BH_POSTGRES_USER:-bloodhound}
- POSTGRES_PASSWORD=${BH_POSTGRES_PASSWORD:-bloodhoundcommunityedition}
- POSTGRES_DB=${BH_POSTGRES_DB:-bloodhound}
ports:
- ${BH_POSTGRES_PORT:-127.0.0.1:5432}:5432
volumes:
- ${BH_POSTGRES_VOLUME:-postgres-data}:/var/lib/postgresql/data
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U ${BH_POSTGRES_USER:-bloodhound} -d 'dbname=${BH_POSTGRES_DB:-bloodhound}' -h 127.0.0.1 -p 5432",
]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
pgadmin:
build:
context: tools/docker-compose
dockerfile: pgadmin.Dockerfile
environment:
PGADMIN_DEFAULT_EMAIL: ${BH_PG_ADMIN_EMAIL:[email protected]}
PGADMIN_DEFAULT_PASSWORD: ${BH_PG_ADMIN_PASSWORD:-bloodhoundcommunityedition}
PGADMIN_LISTEN_PORT: 5050
ports:
- ${BH_PG_ADMIN_PORT:-127.0.0.1:5050}:5050
labels:
- traefik.enable=true
- traefik.http.routers.pgadmin.rule=Host(`${BH_PG_ADMIN_HOSTNAME:-pgadmin.localhost}`)
- traefik.http.routers.pgadmin.service=pgadmin
- traefik.http.services.pgadmin.loadbalancer.server.port=5050
depends_on:
app-db:
condition: service_healthy
graph-db:
build:
args:
memconfig: true
context: tools/docker-compose
dockerfile: neo4j.Dockerfile
environment:
- NEO4J_AUTH=${BH_NEO4J_AUTH:-neo4j/bloodhoundcommunityedition}
- NEO4J_dbms_allow__upgrade=${BH_NEO4J_ALLOW_UPGRADE:-true}
ports:
- ${BH_NEO4J_PORT:-127.0.0.1:7687}:7687
- ${BH_NEO4J_WEB_PORT:-127.0.0.1:7474}:7474
volumes:
- ${BH_NEO4J_VOLUME:-neo4j-data}:/data
labels:
- traefik.enable=true
- traefik.http.routers.neo4jbrowser.rule=Host(`${BH_NEO4J_HOSTNAME:-neo4j.localhost}`)
- traefik.http.routers.neo4jbrowser.service=neo4jbrowser
- traefik.http.services.neo4jbrowser.loadbalancer.server.port=7474
healthcheck:
test:
["CMD-SHELL", "wget -O /dev/null -q http://localhost:7474 || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
bh-api:
profiles:
- dev
- api-only
build:
context: tools/docker-compose
dockerfile: api.Dockerfile
command: "-c .air.toml ${AIR_FLAGS:-''}"
ports:
- ${BH_API_PORT:-127.0.0.1:8080}:8080
- ${TOOLAPI_PORT:-127.0.0.1:2112}:2112
labels:
- traefik.enable=true
- traefik.http.routers.bhapi.rule=Host(`${BH_HOSTNAME:-bloodhound.localhost}`) && PathPrefix(`/api`)
- traefik.http.routers.bhapi.service=bhapi
- traefik.http.services.bhapi.loadbalancer.server.port=8080
volumes:
- .:/bloodhound:ro
- ./local-harnesses/${BH_CONFIG_FILE:-build.config.json}:/build.config.json:ro
- go-pkg-mod:/go/pkg/mod
depends_on:
app-db:
condition: service_healthy
graph-db:
condition: service_healthy
bh-ui:
profiles:
- dev
- ui-only
- debug-api
build:
context: .
dockerfile: tools/docker-compose/ui.Dockerfile
command: sh -c "yarn dev"
labels:
- traefik.enable=true
- traefik.http.routers.bhui.rule=Host(`${BH_HOSTNAME:-bloodhound.localhost}`)
- traefik.http.middlewares.add-bh-ui.addprefix.prefix=/ui
- traefik.http.routers.bhui.service=bhui
- traefik.http.services.bhui.loadbalancer.server.port=3000
volumes:
- ./cmd/ui/public:/bloodhound/cmd/ui/public:ro
- ./cmd/ui/src:/bloodhound/cmd/ui/src:ro
- ./packages/javascript/bh-shared-ui/src:/bloodhound/packages/javascript/bh-shared-ui/src:ro
- ./packages/javascript/js-client-library/src:/bloodhound/packages/javascript/js-client-library/src:ro
- ui-cache:/.cache
debug-api:
profiles:
- debug-api
build:
context: tools/docker-compose
dockerfile: api.Dockerfile
command: "-c .air.debug.toml ${AIR_FLAGS:-''}"
ports:
- ${BH_API_PORT:-127.0.0.1:8080}:8080
- ${TOOLAPI_PORT:-127.0.0.1:2112}:2112
- ${DEBUG_PORT:-127.0.0.1:3456}:2345
labels:
- traefik.enable=true
- traefik.http.routers.debugapi.rule=Host(`${BH_HOSTNAME:-bloodhound.localhost}`) && PathPrefix(`/api`)
- traefik.http.routers.debugapi.service=debugapi
- traefik.http.services.debugapi.loadbalancer.server.port=8080
volumes:
- .:/bloodhound:ro
- ./local-harnesses/${BH_CONFIG_FILE:-build.config.json}:/build.config.json:ro
depends_on:
app-db:
condition: service_healthy
graph-db:
condition: service_healthy
volumes:
neo4j-data:
postgres-data:
go-pkg-mod:
ui-cache: