Added Dockerfile and docker-compose.yml

This commit is contained in:
2022-12-14 23:07:20 +01:00
parent 1cc7669817
commit 41362d2783
3 changed files with 53 additions and 0 deletions

37
Dockerfile Executable file
View File

@@ -0,0 +1,37 @@
FROM alpine:latest
MAINTAINER Christian Baer <chris@debilux.org>
ENV TZ "UTC"
## Run cron every minute
ENV SCHEDULE "* * * * *"
ENV GIT_REPO "https://github.com/chrisb86/nsupdate"
ENV NSUPDATE_CONFD_DIR="/config"
ENV NSUPDATE_LOG_DIR="/log"
## Install requirements
RUN apk update
RUN apk add --update-cache \
git \
curl \
libxml2-utils
# Read timezone from server, so in docker-compose you can change TZ
RUN apk add --no-cache tzdata
RUN ln -sf "/usr/share/zoneinfo/$TZ" /etc/localtime && \
echo "$TZ" > /etc/timezone && date
## Clone git repo
RUN mkdir app
RUN git clone $GIT_REPO /app
## Setup cron job
RUN echo "${SCHEDULE} sh /app/nsupdate.sh" >> /etc/crontabs/root
## Start crond
CMD [ "crond", "-l", "2", "-f" ]
VOLUME /config
VOLUME /log