Optimize docker files
This commit is contained in:
37
Dockerfile
37
Dockerfile
@ -1,37 +0,0 @@
|
|||||||
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
|
|
26
docker/Dockerfile
Executable file
26
docker/Dockerfile
Executable file
@ -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
|
@ -1,9 +1,15 @@
|
|||||||
version: "3.3"
|
version: '3'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
sonarr:
|
nsupdate:
|
||||||
image: nsupdate:latest
|
image: nsupdate
|
||||||
container_name: nsupdate
|
container_name: nsupdate
|
||||||
|
build:
|
||||||
|
context: https://github.com/chrisb86/nsupdate.git
|
||||||
|
dockerfile: docker/Dockerfile
|
||||||
environment:
|
environment:
|
||||||
|
- SCHEDULE="*\2 * * * *"
|
||||||
|
- TZ=Europe/Berlin
|
||||||
- NSUPDATE_INWX_USER=YOUR_INWX_USERNAME
|
- NSUPDATE_INWX_USER=YOUR_INWX_USERNAME
|
||||||
- NSUPDATE_INWX_PASSWORD=YOUR_INWX_PASSWORD
|
- NSUPDATE_INWX_PASSWORD=YOUR_INWX_PASSWORD
|
||||||
volumes:
|
volumes:
|
4
docker/entrypoint.sh
Normal file
4
docker/entrypoint.sh
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
|
||||||
|
echo "${SCHEDULE} sh nsupdate.sh" >> /etc/crontabs/root
|
||||||
|
crond -l 2 -f > /dev/stdout 2> /dev/stderr &
|
Reference in New Issue
Block a user