-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
63 lines (47 loc) · 1.67 KB
/
Dockerfile
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
FROM python:3.7.4-slim
ENV DEBIAN_FRONTEND noninteractive
# docker build -t quay.io/vsoch/freegenes .
ARG ENABLE_LDAP=false
ARG ENABLE_PAM=false
ARG ENABLE_SAML=false
################################################################################
# CORE
# Do not modify this section
RUN apt-get update && apt-get install -y \
cmake \
git \
libxmlsec1-dev \
openssl \
pkg-config \
wget \
vim
# Install Python requirements out of /tmp so not triggered if other contents of /code change
ADD requirements.txt /tmp/requirements.txt
RUN pip install --upgrade pip
RUN pip install -r /tmp/requirements.txt
ADD . /code/
################################################################################
# PLUGINS
# You are free to uncomment the plugins that you want to use
# Install LDAP
RUN if $ENABLE_LDAP; then pip install python3-ldap ; fi;
RUN if $ENABLE_LDAP; then pip install django-auth-ldap ; fi;
# Install PAM Authentication
RUN if $ENABLE_PAM; then pip install django-pam ; fi;
# Install SAML
RUN if $ENABLE_SAML; then pip install python3-saml ; fi;
RUN if $ENABLE_SAML; then pip install social-auth-core[saml] ; fi;
################################################################################
# BASE
RUN mkdir -p /code && mkdir -p /code/data
RUN mkdir -p /var/www/data && chmod -R 0755 /code/data/
WORKDIR /code
RUN apt-get autoremove -y && \
apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install crontab to run tasks - keep backup last 2 days
RUN apt-get update && apt-get install -y cron
RUN echo "0 1 * * * /bin/bash /code/scripts/backup_db.sh" >> /code/cronjob
RUN crontab /code/cronjob
CMD /code/docker/run_uwsgi.sh
EXPOSE 3031