Skip to content

Commit

Permalink
chore(pr) add docker compose (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
tsutsu3 authored Nov 17, 2024
1 parent 89dd7cf commit dad5e9a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Unbound Configuration Path
# Select one of the following options:
# - unix: Unix Domain Socket
# - tls: TLS Socket
UNBOUND_CONF_PATH=./unbound-config/unix
# UNBOUND_CONF_PATH=./unbound-config/tls
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,6 @@ dist-ssr
*.sw?


coverage/
coverage/
unbound-config/*
!unbound-config/unbound.conf
31 changes: 31 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
services:
unbound-setup:
image: mvance/unbound:latest
volumes:
- ${UNBOUND_CONF_PATH}:/opt/unbound/etc/unbound
restart: "no"
entrypoint: []
command: >-
/bin/sh -c "
if [ ! -f /opt/unbound/etc/unbound/key/unbound_server.key ]; then
echo 'Setup start' &&
unbound-control-setup &&
mkdir /opt/unbound/etc/unbound/key &&
mv /opt/unbound/etc/unbound/unbound_* /opt/unbound/etc/unbound/key &&
echo 'Setup complete';
else
echo 'Certificates already exist';
fi
"
unbound:
image: mvance/unbound:latest
container_name: unbound
ports:
- "53:53/tcp"
- "53:53/udp"
- "8953:8953"
volumes:
- ${UNBOUND_CONF_PATH}:/opt/unbound/etc/unbound
restart: unless-stopped
depends_on:
- unbound-setup

0 comments on commit dad5e9a

Please sign in to comment.