Skip to content

Commit

Permalink
Optimize docker files
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisb86 committed Jan 27, 2023
1 parent 41362d2 commit 274d7bc
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 40 deletions.
37 changes: 0 additions & 37 deletions Dockerfile

This file was deleted.

26 changes: 26 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM alpine:latest

ENV TZ "UTC"
ENV SCHEDULE "* * * * *"

## Configure runtime variables for nsupdate
ENV NSUPDATE_CONFD_DIR="/config"
ENV NSUPDATE_LOG_DIR="/log"

## Install requirements
RUN apk update
RUN apk add --no-cache git curl libxml2-utils tzdata

# Read timezone from server, so in docker-compose you can change TZ
RUN ln -sf "/usr/share/zoneinfo/${TZ}" /etc/localtime && \
echo "${TZ}" > /etc/timezone && date

COPY ../nsupdate.sh /usr/local/bin/nsupdate.sh
RUN chmod +x /usr/local/bin/nsupdate.sh

COPY docker/entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]

VOLUME /config
VOLUME /log
12 changes: 9 additions & 3 deletions docker-compose.yml → docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
version: "3.3"
version: '3'

services:
sonarr:
image: nsupdate:latest
nsupdate:
image: nsupdate
container_name: nsupdate
build:
context: https://github.com/chrisb86/nsupdate.git
dockerfile: docker/Dockerfile
environment:
- SCHEDULE="*\2 * * * *"
- TZ=Europe/Berlin
- NSUPDATE_INWX_USER=YOUR_INWX_USERNAME
- NSUPDATE_INWX_PASSWORD=YOUR_INWX_PASSWORD
volumes:
Expand Down
4 changes: 4 additions & 0 deletions docker/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#! /bin/sh

echo "${SCHEDULE} sh nsupdate.sh" >> /etc/crontabs/root
crond -l 2 -f > /dev/stdout 2> /dev/stderr &

0 comments on commit 274d7bc

Please sign in to comment.