diff --git a/Dockerfile.nipapd b/Dockerfile.nipapd index 0b7a91fe1..daa7a0500 100644 --- a/Dockerfile.nipapd +++ b/Dockerfile.nipapd @@ -32,41 +32,38 @@ # via a volume. # -FROM ubuntu:bionic +FROM ubuntu:jammy MAINTAINER Kristian Larsson ENV DEBIAN_FRONTEND=noninteractive # apt update, upgrade & install packages RUN apt-get update -qy && apt-get upgrade -qy \ - && apt-get install -qy devscripts \ - make \ + && apt-get install --no-install-recommends -qy build-essential \ libpq-dev \ + libldap-dev \ + libsasl2-dev \ libsqlite3-dev \ postgresql-client \ - software-properties-common \ python3 \ - python3-all \ - python3-pip \ python3-dev \ - libsasl2-dev \ - libldap2-dev \ - libssl-dev \ - && rm -rf /var/lib/apt/lists/* + python3-pip \ + software-properties-common \ + && apt clean # Install any additional CA certs from ca_certs folder required by corp proxies etc -RUN mkdir -p /usr/share/ca-certificates/extra -COPY ca_certs/*.crt /usr/share/ca-certificates/extra/ -RUN ls /usr/share/ca-certificates/extra/*.crt | sed 's/\/usr\/share\/ca-certificates\///g' >> /etc/ca-certificates.conf -RUN update-ca-certificates -RUN pip3 install --upgrade pip +COPY ca_certs/ / +RUN mkdir -p /usr/local/share/ca-certificates \ + && cp /ca_certs/*.crt /usr/local/share/ca-certificates/ || true \ + && rm -rf /ca_certs \ + && update-ca-certificates RUN pip3 config set global.cert /etc/ssl/certs/ca-certificates.crt COPY nipap /nipap WORKDIR /nipap -RUN pip3 install --no-input envtpl -RUN pip3 --no-input install -r requirements.txt \ +RUN pip3 --no-input install --no-cache-dir envtpl==0.7.2 \ + && pip3 --no-input install --no-cache-dir -r requirements.txt \ && python3 setup.py install EXPOSE 1337 diff --git a/Dockerfile.www b/Dockerfile.www index aec7b17af..6874c386c 100644 --- a/Dockerfile.www +++ b/Dockerfile.www @@ -23,38 +23,38 @@ # database so that you can later login to the web interface. # -FROM ubuntu:xenial +FROM ubuntu:jammy MAINTAINER Lukas Garberg +ENV DEBIAN_FRONTEND=noninteractive + ENV NIPAPD_HOST=nipapd NIPAPD_PORT=1337 WWW_USERNAME=guest WWW_PASSWORD=guest # apt update, upgrade & install packages RUN apt-get update -qy && apt-get upgrade -qy \ - && apt-get install -qy apache2 \ - libapache2-mod-wsgi \ - devscripts \ - make \ + && apt-get install --no-install-recommends -qy apache2 \ + build-essential \ + libapache2-mod-wsgi-py3 \ libpq-dev \ + libldap-dev \ + libsasl2-dev \ libsqlite3-dev \ postgresql-client \ - python \ - python-all \ - python-docutils \ - python-pip \ - python-dev \ - python-markupsafe \ - python-jinja2 \ - && pip --no-input install envtpl \ - && rm -rf /var/lib/apt/lists/* + python3 \ + python3-all \ + python3-pip \ + python3-dev \ + && pip3 --no-input install envtpl==0.7.2 \ + && apt clean # Install pynipap, nipap and nipap-www COPY pynipap /pynipap COPY nipap /nipap COPY nipap-www /nipap-www -RUN cd /pynipap && python setup.py install && \ - cd /nipap && pip --no-input install -r requirements.txt && python setup.py install && \ - cd /nipap-www && pip --no-input install -r requirements.txt && python setup.py install && \ +RUN cd /pynipap && python3 setup.py install && \ + cd /nipap && pip3 --no-input install --no-cache-dir -r requirements.txt && python3 setup.py install && \ + cd /nipap-www && pip3 --no-input install --no-cache-dir -r requirements.txt && python3 setup.py install && \ cd .. EXPOSE 80 diff --git a/nipap-www/entrypoint.sh b/nipap-www/entrypoint.sh index 5a0e48f09..86cc37874 100755 --- a/nipap-www/entrypoint.sh +++ b/nipap-www/entrypoint.sh @@ -13,10 +13,6 @@ if [ `nipap-passwd list | egrep -c ^$WWW_USERNAME\\\s` -eq 0 ]; then /usr/sbin/nipap-passwd add -u $WWW_USERNAME -p $WWW_PASSWORD -n "NIPAP WWW user" -t fi -# Fix permissions -chown -R www-data:www-data /var/cache/nipap-www -chmod -R u=rwX /var/cache/nipap-www - # Configure apache cat << EOF > /etc/apache2/sites-available/000-default.conf