-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
133 lines (126 loc) · 4 KB
/
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
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
---
# This docker-compose file is written for development purposes.
# It is not recommended to use this file for production purposes without any changes.
version: "3.9"
services:
# Init container
astronomican_init:
image: "astronomican"
container_name: "astronomican_init"
command: "sh -c 'python manage.py collectstatic --noinput --clear && python manage.py migrate --noinput'"
env_file:
- ./docker-compose.d/.env-local
volumes:
- "./:/opt/astronomican"
- "./config.yaml:/opt/astronomican/config.yaml"
network_mode: host
extra_hosts:
- "mariadb:127.0.0.1"
depends_on:
mariadb:
condition: service_healthy
# Astronomican container
astronomican_web:
image: "astronomican"
container_name: "astronomican_web"
ports:
- "127.0.0.1:8001:8001"
command: "sh -c 'python manage.py runserver 0.0.0.0:8001'"
env_file:
- ./docker-compose.d/.env-local
volumes:
- "./:/opt/astronomican"
- "./config.yaml:/opt/astronomican/config.yaml"
network_mode: host
extra_hosts:
- "mariadb:127.0.0.1"
depends_on:
astronomican_init:
condition: service_completed_successfully
mariadb:
condition: service_healthy
kea_ctrl_agent:
condition: service_healthy
# Kea DHCP container
kea_init:
image: "nixknight/kea:latest"
container_name: "kea_init"
command: "/tmp/kea-init/init.sh"
user: "_kea"
volumes:
- "./docker-compose.d/kea-init:/tmp/kea-init"
network_mode: host
extra_hosts:
- "mariadb:127.0.0.1"
depends_on:
mariadb:
condition: service_healthy
# Kea DHCP container
kea_dhcp:
image: "nixknight/kea:latest"
container_name: "kea_dhcp"
command: "/usr/local/sbin/kea-dhcp4 -c /usr/local/etc/kea/kea-dhcp4.conf"
environment:
- KEA_LOCKFILE_DIR=/usr/local/var/run/kea/kea-dhcp4-server
volumes:
- "kea_dhcp_server:/usr/local/var/run/kea/kea-dhcp4-server"
- "./examples/config/kea/kea-dhcp4.conf.example:/usr/local/etc/kea/kea-dhcp4.conf"
healthcheck:
test: ["CMD", "echo", "'{\"command\": \"status-get\"}'", "|", "socat", "/usr/local/var/run/kea/kea-dhcp4-server/kea4-ctrl-socket", "-,ignoreeof"]
timeout: 20s
retries: 10
network_mode: host
extra_hosts:
- "mariadb:127.0.0.1"
depends_on:
kea_init:
condition: service_completed_successfully
mariadb:
condition: service_healthy
# Kea Control Agent container
kea_ctrl_agent:
image: "nixknight/kea:latest"
container_name: "kea_ctrl_agent"
command: "/usr/local/sbin/kea-ctrl-agent -c /usr/local/etc/kea/kea-ctrl-agent.conf"
environment:
- KEA_LOCKFILE_DIR=/usr/local/var/run/kea/kea-ctrl-agent
volumes:
- "kea_dhcp_server:/usr/local/var/run/kea/kea-dhcp4-server"
- "kea_ctrl_agent:/usr/local/var/run/kea/kea-ctrl-agent"
- "./examples/config/kea/kea-ctrl-agent.conf.example:/usr/local/etc/kea/kea-ctrl-agent.conf"
ports:
- "127.0.0.1:8002:8002"
healthcheck:
test: ["CMD", "curl", "-X", "POST", "-H", "\"Content-Type: application/json\"", "-d", "'{ \"command\": \"status-get\", \"service\": [ \"dhcp4\" ] }'", "-u", "\"admin:1234\"", "http://127.0.0.1:8002/"]
timeout: 20s
retries: 10
network_mode: host
depends_on:
kea_dhcp:
condition: service_healthy
# MariaDB container
mariadb:
container_name: "mariadb"
image: "mariadb:10.11.4-jammy"
env_file:
- ./docker-compose.d/.env-local
volumes:
- "mariadb:/var/lib/mysql"
- "./docker-compose.d/mariadb-init:/docker-entrypoint-initdb.d"
ports:
- "127.0.0.1:3307:3306"
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
network_mode: host
# DHCP client test container
dhcp-client-test:
container_name: "dhcp_test"
image: "debian:bookworm-slim"
command: "sleep 99d"
network_mode: host
volumes:
kea_dhcp_server:
kea_ctrl_agent:
mariadb: