diff --git a/docker/fradrive/Dockerfile b/docker/fradrive/Dockerfile new file mode 100644 index 000000000..eafee5b66 --- /dev/null +++ b/docker/fradrive/Dockerfile @@ -0,0 +1,28 @@ +from registry.uniworx.de/fradrive/fradrive/fradrive-env:latest + +user root + +# Install uniworx binary +workdir /fradrive +run pwd && ls -a && cat Dockerfile && make bin/uniworx + +# Runtime dependencies +# TODO: minimize texlive dependencies, switch to basic schemes where possible +run apt-get -y install texlive-latex-recommended texlive-latex-extra texlive-luatex texlive-fonts-recommended texlive-fonts-extra texlive-lang-english texlive-lang-german + +# TODO: build container (see nix build) + +# TODO: remove build dependencies (e.g. nodejs) + +run mkdir -p /var/lib +run groupadd -r uniworx +run useradd -r -g uniworx -d /var/lib/uniworx -M uniworx --uid 999 +run install -d -g uniworx -o uniworx -m 0750 /var/lib/uniworx +run mkdir -p /var/log +run install -d -g uniworx -o uniworx -m 0755 /var/log/uniworx + +user uniworx + +entrypoint fradrive-entrypoint.sh +expose 8080/tcp +volume /var/lib/uniworx /var/log diff --git a/docker/fradrive/fradrive-entrypoint.sh b/docker/fradrive/fradrive-entrypoint.sh new file mode 100644 index 000000000..9f92bb4b4 --- /dev/null +++ b/docker/fradrive/fradrive-entrypoint.sh @@ -0,0 +1,20 @@ +#!/nix/store/r0wrj1l79j267np3z5i657pnprsd74fq-zsh-5.8/bin/zsh -xe + +cTime=$(date -Is) + +# export LOGDEST=/var/log/uniworx/${cTime}.log # kubernetes prefers log via stdout + +typeset -a configs + +configDir=${CONFIG_DIR-/cfg} +configs=() +if [[ -d "${configDir}" ]]; then + while IFS= read -d $'\0' cfg; do + configs+=("${(q)cfg}") + done < <(find "${configDir}" \( -name '*.yml' -o -name '*.yaml' \) -print0 | sort -rz) +fi +configs+=('/nix/store/mr2s10y1pj1fx594gjx0qlvc704n1j00-uni2work.yml') + +cd /var/lib/uniworx + +exec -- uniworx ${configs}