refactor(docker): apply Dockerfile linter suggestions

This commit is contained in:
Sarah Vaupel 2024-07-25 13:05:24 +02:00
parent 9fb6d60ecc
commit 60e5086f7e
2 changed files with 33 additions and 35 deletions

View File

@ -1,45 +1,43 @@
from registry.uniworx.de/uniworx/containers/debian:12.5
FROM registry.uniworx.de/uniworx/containers/debian:12.5
run apt-get -y update
RUN apt-get -y update
# Required packages
run apt-get -y install git git-restore-mtime exiftool g++ npm libsodium-dev haskell-stack zsh wget curl
RUN apt-get -y install git git-restore-mtime exiftool g++ npm libsodium-dev haskell-stack zsh wget curl
# packages that we might require (copied from uni2work)
# TODO: review
run apt-get -y install --no-install-recommends locales-all ca-certificates
RUN apt-get -y install --no-install-recommends locales-all ca-certificates
# frontend
run npm install -g n
run n 14.19.1
RUN npm install -g n
RUN n 14.19.1
# backend
run stack install happy
RUN stack install happy
# run git restore-mtime
# frontend-test
run apt-get -y install chromium
RUN apt-get -y install chromium
# frontend-test
env CHROME_BIN=chromium
ENV CHROME_BIN=chromium
# backend-dependencies
run apt-get -y install libghc-zlib-dev
RUN apt-get -y install libghc-zlib-dev
# backend-dependencies
run apt-get -y install libpq-dev
RUN apt-get -y install libpq-dev
# backend-dependencies
run apt-get -y install pkg-config
RUN apt-get -y install pkg-config
run apt-get -y install locales
run sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
RUN apt-get -y install locales
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen
env LANG en_US.UTF-8
env LANGUAGE en_US:en
env LC_ALL en_US.UTF-8
ENV LANG=en_US.UTF-8 LANGUAGE=en_US:en LC_ALL=en_US.UTF-8
run apt-get -y install llvm
RUN apt-get -y install llvm
run useradd -ms /bin/bash fradrive-env
user fradrive-env
RUN useradd -ms /bin/bash fradrive-env
USER fradrive-env

View File

@ -1,28 +1,28 @@
from registry.uniworx.de/fradrive/fradrive/fradrive-env:latest
FROM registry.uniworx.de/fradrive/fradrive/fradrive-env:latest
user root
USER root
# Install uniworx binary
workdir /fradrive
run pwd && ls -a && cat Dockerfile && make bin/uniworx
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
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
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
USER uniworx
entrypoint fradrive-entrypoint.sh
expose 8080/tcp
volume /var/lib/uniworx /var/log
ENTRYPOINT fradrive-entrypoint.sh
EXPOSE 8080/tcp
VOLUME /var/lib/uniworx /var/log