-
Notifications
You must be signed in to change notification settings - Fork 132
/
Dockerfile.nipapd
74 lines (66 loc) · 2.79 KB
/
Dockerfile.nipapd
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
74
# This file describes a docker image for running nipapd in docker
#
# Build the docker image:
# docker build -t nipapd -f Dockerfile.nipapd .
#
# Run by linking to the container running postgres. -i -t is for interactive,
# use -d if you wish to run the container in the background:
# docker run -i -t --link nipap-db --name nipapd nipapd
#
# Most configuration variables are provided via environment variables.
# LISTEN_ADDRESS address on which nipapd should listen [0.0.0.0]
# LISTEN_PORT port on which nipapd should listen [1337]
# SYSLOG true / false enable syslog? [false]
# DB_HOST host where database is running
# DB_PORT port of database [5432]
# DB_NAME name of database
# DB_USERNAME username to authenticate to database
# DB_PASSWORD password to authenticate to database
# DB_SSLMODE require ssl? [disable]
# NIPAP_USERNAME name of account to create
# NIPAP_PASSWORD password of account to create
#
# Some values have a default, indicated in square brackets, the rest you need
# to fill in. If you are linking to a container running postgres, just enter
# the name of the container as DB_HOST and use the credentials with which you
# started that container.
#
# NIPAP_USERNAME & NIPAP_PASSWORD is used to create a new account in the local
# auth database of nipapd so that you can later authenticate towards nipapd. It
# is only possible to add a single account. If you wish to add more accounts
# you should administrate the database outside and share it with the container
# via a volume.
#
FROM ubuntu:jammy
MAINTAINER Kristian Larsson <kristian@spritelink.net>
ENV DEBIAN_FRONTEND=noninteractive
# apt update, upgrade & install packages
RUN apt-get update -qy && apt-get upgrade -qy \
&& apt-get install --no-install-recommends -qy build-essential \
libpq-dev \
libldap-dev \
libsasl2-dev \
libsqlite3-dev \
postgresql-client \
python3 \
python3-dev \
python3-pip \
software-properties-common \
&& 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
COPY nipap /nipap
WORKDIR /nipap
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
ENV LISTEN_ADDRESS=0.0.0.0 LISTEN_PORT=1337 SYSLOG=false DB_PORT=5432 DB_SSLMODE=disable DB_NAME=nipap
ENTRYPOINT ["/nipap/entrypoint.sh"]