forked from grahamgilbert/Crypt-Server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
69 lines (61 loc) · 2.18 KB
/
Dockerfile
File metadata and controls
69 lines (61 loc) · 2.18 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
# Crypt Server Dockerfile
FROM ubuntu:14.04.1
MAINTAINER Graham Gilbert <graham@grahamgilbert.com>
# Basic env vars for apt and Passenger
ENV HOME /root
ENV DEBIAN_FRONTEND noninteractive
ENV TZ America/New_York
ENV APP_DIR /home/docker/crypt
# DOCKER_CRYPT_* env vars configure the following possible settings in Crypt's
# settings.py:
# DOCKER_CRYPT_ADMINS = A list of lists (tuples) of names and email addresses of authorized admins
# DOCKER_CRYPT_ALLOWED = A list of allowed hosts or IP addresses, defaults to *
# DOCKER_CRYPT_LANG = Preferred language
# DOCKER_CRYPT_TZ = Time zone to use for GUI and logging
# To define multiple admins: Some Name,some@where.com:Another One,another@host.net
ENV DOCKER_CRYPT_ADMINS Admin User,admin@test.com
# ENV DOCKER_CRYPT_ALLOWED myhost,1.2.3.4,anotherhost.fqdn.com
ENV DOCKER_CRYPT_LANG en_US
ENV DOCKER_CRYPT_TZ America/New_York
ADD / $APP_DIR
RUN apt-get update && \
apt-get install -y software-properties-common && \
apt-get -y update && \
add-apt-repository -y ppa:nginx/stable && \
apt-get -y install \
git \
python-setuptools \
nginx \
postgresql \
postgresql-contrib \
libpq-dev \
python-dev \
supervisor \
nano \
libffi-dev && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN easy_install pip && \
pip install -r $APP_DIR/setup/requirements.txt && \
pip install psycopg2==2.5.3 && \
pip install gunicorn && \
pip install setproctitle
ADD docker/nginx/nginx-env.conf /etc/nginx/main.d/
ADD docker/nginx/crypt.conf /etc/nginx/sites-enabled/crypt.conf
ADD docker/nginx/nginx.conf /etc/nginx/nginx.conf
ADD docker/settings.py $APP_DIR/fvserver/
ADD docker/settings_import.py $APP_DIR/fvserver/
ADD docker/wsgi.py $APP_DIR/
ADD docker/gunicorn_config.py $APP_DIR/
ADD docker/django/management/ $APP_DIR/server/management/
ADD docker/run.sh /run.sh
ADD docker/supervisord.conf $APP_DIR/supervisord.conf
RUN update-rc.d -f postgresql remove && \
update-rc.d -f nginx remove && \
rm -f /etc/nginx/sites-enabled/default && \
mkdir -p /home/app && \
mkdir -p /home/backup && \
ln -s $APP_DIR /home/app/crypt
EXPOSE 8000
VOLUME $APP_DIR/keyset
CMD ["/run.sh"]