-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
116 lines (107 loc) · 2.79 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
x-netbox: &netbox
image: quay.io/zebbra/netbox:v4.1.11-plugins
depends_on:
- postgres
- valkey
- valkey-cache
env_file: ./.docker/netbox/netbox.env
user: 'unit:root'
volumes:
- ./.docker/netbox/configuration/extra.py:/etc/netbox/config/extra.py:z,ro
- ./.docker/netbox/media:/opt/netbox/netbox/media:rw
- ./.docker/netbox/reports:/opt/netbox/netbox/reports:rw
- ./.docker/netbox/scripts:/opt/netbox/netbox/scripts:rw
services:
postgres:
image: postgres:16
user: ${USER_UID}:${USER_GID}
volumes:
- "./.docker/postgres/data:/var/lib/postgresql/data/pgdata:rw"
- "./.docker/postgres/import:/import:rw"
environment:
PGDATA: /var/lib/postgresql/data/pgdata
POSTGRES_PASSWORD: netbox
POSTGRES_USER: netbox
POSTGRES_DB: netbox
ports:
- "127.0.0.1:5432:5432"
valkey:
image: docker.io/valkey/valkey:8.0-alpine
command:
- valkey-server
- --appendonly yes
healthcheck: &valkey-healthcheck
test: '[ $$(valkey-cli ping) = ''PONG'' ]'
start_period: 5s
timeout: 3s
interval: 1s
retries: 5
valkey-cache:
image: docker.io/valkey/valkey:8.0-alpine
command:
- valkey-server
healthcheck: *valkey-healthcheck
netbox:
<<: *netbox
ports:
- "127.0.0.1:8080:8080"
healthcheck:
start_period: 120s
timeout: 10s
interval: 60s
test: "curl -f http://localhost:8080/ || exit 1"
netbox-worker:
<<: *netbox
depends_on:
netbox:
condition: service_healthy
command:
- /opt/netbox/venv/bin/python
- /opt/netbox/netbox/manage.py
- rqworker
healthcheck:
start_period: 20s
timeout: 3s
interval: 15s
test: "ps -aux | grep -v grep | grep -q rqworker || exit 1"
netbox-housekeeping:
<<: *netbox
depends_on:
netbox:
condition: service_healthy
command:
- /opt/netbox/housekeeping.sh
healthcheck:
start_period: 20s
timeout: 3s
interval: 15s
test: "ps -aux | grep -v grep | grep -q housekeeping || exit 1"
ansible:
build: .
depends_on:
netbox:
condition: service_healthy
command:
- sleep
- inf
network_mode: host
environment:
NETBOX_URL: ${NETBOX_URL}
NETBOX_TOKEN: ${NETBOX_TOKEN}
volumes:
- "./test_data/device_types:/srv/init/device_types"
- "./test_data/vars:/srv/init/vars"
- "./test_data/gen:/srv/init/gen"
ansible-init:
profiles: ["init"]
build: .
depends_on:
netbox:
condition: service_healthy
network_mode: host
environment:
NETBOX_URL: ${NETBOX_URL}
NETBOX_TOKEN: ${NETBOX_TOKEN}
volumes:
- "./test_data/device_types:/srv/init/device_types"
- "./test_data/vars:/srv/init/vars"