-
Notifications
You must be signed in to change notification settings - Fork 132
/
Dockerfile.www
73 lines (64 loc) · 2.55 KB
/
Dockerfile.www
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# This file describes a docker image for running nipap-www in docker
#
# Build the docker image:
# docker build -t nipap-www -f Dockerfile.www .
#
# Run by linking to the container running nipapd. -i -t is for interactive,
# use -d if you wish to run the container in the background:
# docker run -i -t --link nipapd --name nipap-www nipap-www
#
# Most configuration variables are provided via environment variables.
# NIPAPD_USERNAME username to authenticate to nipapd
# NIPAPD_PASSWORD password to authenticate to nipapd
# NIPAPD_HOST host where nipapd is running [nipapd]
# NIPAPD_PORT port of nipapd [1337]
# WWW_USERNAME web UI username [guest]
# WWW_PASSWORD web UI password [guest]
#
# Some variables have a default, indicated in square brackets, the rest you need
# to fill in. If you are linking to a container running nipapd, just enter the
# name of the container as NIPAPD_HOST.
#
# WWW_USERNAME & WWW_PASSWORD is used to create a new account in the local auth
# database so that you can later login to the web interface.
#
FROM ubuntu:jammy
MAINTAINER Lukas Garberg <lukas@spritelink.net>
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 --no-install-recommends -qy apache2 \
build-essential \
libapache2-mod-wsgi-py3 \
libpq-dev \
libldap-dev \
libsasl2-dev \
libsqlite3-dev \
postgresql-client \
python3 \
python3-all \
python3-pip \
python3-dev \
&& pip3 --no-input install --no-cache-dir envtpl==0.7.2 \
&& apt-get clean
# Install any additional CA certs from ca_certs folder required by corp proxies etc
RUN mkdir /ca_certs
COPY ca_certs/ /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
ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
# Install pynipap, nipap and nipap-www
COPY pynipap /pynipap
COPY nipap /nipap
COPY nipap-www /nipap-www
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
VOLUME [ "/var/log/apache2" ]
ENTRYPOINT [ "/nipap-www/entrypoint.sh" ]