forked from SpriteLink/NIPAP
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.nipapd
75 lines (67 loc) · 2.78 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
75
# 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:bionic
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 \
libpq-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/*
# 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
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 \
&& python3 setup.py install
EXPOSE 1337
ENV LISTEN_ADDRESS=0.0.0.0 LISTEN_PORT=1337 SYSLOG=false DB_PORT=5432 DB_SSLMODE=disable
ENTRYPOINT ["/nipap/entrypoint.sh"]