Skip to content

Commit

Permalink
packaging: Updated Dockerfiles
Browse files Browse the repository at this point in the history
Updated Dockerfiles:
* Base on Ubuntu 22.04
* Misc fixes required to make them build
* Removed Pylons-specific fix
* Style fixes
  • Loading branch information
garberg committed Apr 16, 2024
1 parent e583719 commit 62d7daa
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 38 deletions.
31 changes: 14 additions & 17 deletions Dockerfile.nipapd
Original file line number Diff line number Diff line change
Expand Up @@ -32,41 +32,38 @@
# via a volume.
#

FROM ubuntu:bionic
FROM ubuntu:jammy
MAINTAINER Kristian Larsson <[email protected]>

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
Expand Down
34 changes: 17 additions & 17 deletions Dockerfile.www
Original file line number Diff line number Diff line change
Expand Up @@ -23,38 +23,38 @@
# database so that you can later login to the web interface.
#

FROM ubuntu:xenial
FROM ubuntu:jammy

MAINTAINER Lukas Garberg <[email protected]>

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
Expand Down
4 changes: 0 additions & 4 deletions nipap-www/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
<VirtualHost *:80>
Expand Down

0 comments on commit 62d7daa

Please sign in to comment.