forked from Uninett/nav
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile3
More file actions
83 lines (71 loc) · 3.32 KB
/
Dockerfile3
File metadata and controls
83 lines (71 loc) · 3.32 KB
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
76
77
78
79
80
81
82
83
# NAV web development container
#
# This container aims at providing all the build- and runtime dependencies of
# NAV in a single container, and allowing for running them all directly off
# the code in your source code checkout.
#
# Run the container with your checked out NAV source code directory mounted on
# the '/source' volume to build and run all the necessary components inside
# the container. Changes to you SASS source files will be automatically
# detected and compiled, and any changes to files in the python directory will
# be immediately live in the web interface.
#
# The NAV web interface is exposed through Apache/WSGI on port 80.
#
# REQUIREMENT: For the users inside the container to be able to access the
# source code mounted at /source, the directory and its files on the host must
# be world-readable!
#
#
FROM debian:stretch
#### Install various build and runtime requirements as Debian packages ####
RUN echo "\
deb http://deb.debian.org/debian stretch main contrib non-free\n\
deb-src http://deb.debian.org/debian stretch main contrib non-free\n\
\n\
deb http://deb.debian.org/debian stretch-updates main contrib non-free\n\
deb-src http://deb.debian.org/debian stretch-updates main contrib non-free\n\
\n\
deb http://security.debian.org stretch/updates main contrib non-free\n\
deb-src http://security.debian.org stretch/updates main contrib non-free\n\
" > /etc/apt/sources.list
RUN apt-get update && apt-get -y install --no-install-recommends \
curl gnupg dirmngr sudo cron inotify-tools supervisor \
git \
vim less \
python python-dev python-pip build-essential \
python3 python3-dev python3-pip \
apache2 \
libapache2-mod-wsgi-py3 \
libsnmp30 \
rubygems ruby-dev \
python-cairo \
postgresql-client \
libxml2-dev libxslt1-dev \
libwww-perl \
nbtscan \
python3-gammu
RUN apt-get update && apt-get -y --no-install-recommends build-dep \
python3-psycopg2 python-lxml python3-pil python-ldap
RUN gem install --version '3.3.9' sass ;\
gem install --version '~> 0.9' rb-inotify
RUN adduser --system --group --no-create-home --home=/source --shell=/bin/bash nav
# Ensure Python 3 is the default interpreter for Python, and fix broken
# supervisor that required Python 2, but doesn't specify it:
RUN echo "import sys\nsys.path.append('/source/python')" > /etc/python3.5/sitecustomize.py
RUN update-alternatives --install /usr/bin/python python /usr/bin/python2.7 1 && \
update-alternatives --install /usr/bin/python python /usr/bin/python3.5 2 && \
dpkg -L supervisor | grep /usr/bin/ | xargs -r sed -i 's,#!/usr/bin/python,#!/usr/bin/python2,g'
COPY tools/docker/supervisord.conf /etc/supervisor/conf.d/nav.conf
COPY requirements/ /requirements
COPY tests/requirements.txt /test-requirements.txt
RUN pip3 install --upgrade pip && hash -r && pip install -r /requirements/base.txt -r /requirements/django18.txt && pip install -r /test-requirements.txt
COPY tools/docker/nav-apache-site.conf /etc/apache2/sites-available/nav-site.conf
RUN a2dissite 000-default; a2ensite nav-site
COPY tools/docker/full-nav-restore.sh /usr/local/sbin/full-nav-restore.sh
VOLUME ["/source"]
ENV PYTHONPATH /source/python
ENV PATH /source/bin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin
RUN echo "PATH=$PATH" > /etc/profile.d/navpath.sh
EXPOSE 80
CMD ["/source/tools/docker/run.sh"]