First commit
This commit is contained in:
commit
45cffd4b9e
14
.gitignore
vendored
Executable file
14
.gitignore
vendored
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
# Compiled Python files
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Folder view configuration files
|
||||||
|
.DS_Store
|
||||||
|
Desktop.ini
|
||||||
|
|
||||||
|
# Thumbnail cache files
|
||||||
|
._*
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Files that might appear on external disks
|
||||||
|
.Spotlight-V100
|
||||||
|
.Trashes
|
23
Dockerfile
Executable file
23
Dockerfile
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
FROM debian:bullseye-slim
|
||||||
|
|
||||||
|
# Install NSD and required tools
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends nsd tzdata && \
|
||||||
|
apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Create necessary directories
|
||||||
|
RUN mkdir -p /var/lib/nsd /var/run/nsd /etc/nsd/conf.d
|
||||||
|
|
||||||
|
# Copy entrypoint script
|
||||||
|
COPY entrypoint.sh /entrypoint.sh
|
||||||
|
RUN chmod +x /entrypoint.sh
|
||||||
|
|
||||||
|
# Volume for configuration and data
|
||||||
|
VOLUME ["/etc/nsd", "/var/lib/nsd"]
|
||||||
|
|
||||||
|
# Expose standard NSD port
|
||||||
|
EXPOSE 53/tcp 53/udp
|
||||||
|
|
||||||
|
# Set start command
|
||||||
|
ENTRYPOINT ["/entrypoint.sh"]
|
14
compose.yml
Executable file
14
compose.yml
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
services:
|
||||||
|
nsd:
|
||||||
|
image: git.debilux.org/chris/docker-nsd
|
||||||
|
container_name: nsd
|
||||||
|
restart: unless-stopped
|
||||||
|
ports:
|
||||||
|
- "53:53/tcp"
|
||||||
|
- "53:53/udp"
|
||||||
|
environment:
|
||||||
|
- PUID=${PUID}
|
||||||
|
- PGID=${PGID}
|
||||||
|
- TZ=${TZ}
|
||||||
|
volumes:
|
||||||
|
- ./config:/etc/nsd
|
29
entrypoint.sh
Executable file
29
entrypoint.sh
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Default UID and GID if not specified
|
||||||
|
PUID=${PUID:-101}
|
||||||
|
PGID=${PGID:-101}
|
||||||
|
# Default timezone if not specified
|
||||||
|
TZ=${TZ:-Etc/UTC}
|
||||||
|
|
||||||
|
# Set the timezone
|
||||||
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
|
||||||
|
echo "$TZ" >/etc/timezone
|
||||||
|
echo "Timezone set to $TZ"
|
||||||
|
|
||||||
|
# Adjust GID for the nsd group
|
||||||
|
groupmod -o -g "$PGID" nsd
|
||||||
|
echo "GID for group nsd adjusted to $PGID"
|
||||||
|
|
||||||
|
# Adjust UID for the nsd user
|
||||||
|
usermod -o -u "$PUID" nsd
|
||||||
|
echo "UID for user nsd adjusted to $PUID"
|
||||||
|
|
||||||
|
# Set correct permissions
|
||||||
|
chown -R nsd:nsd /var/lib/nsd /var/run/nsd /etc/nsd
|
||||||
|
echo "Permissions adjusted"
|
||||||
|
|
||||||
|
# Start NSD in the foreground with reduced warnings
|
||||||
|
echo "Starting NSD..."
|
||||||
|
exec nsd -d
|
Loading…
x
Reference in New Issue
Block a user