-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
155 lines (151 loc) · 6.04 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
FROM jhpyle/docassemble-os
COPY . /tmp/docassemble/
RUN DEBIAN_FRONTEND=noninteractive TERM=xterm \
bash -c \
"ln -s /var/mail/mail /var/mail/root \
&& cp /tmp/docassemble/docassemble_webapp/docassemble.wsgi /usr/share/docassemble/webapp/ \
&& cp /tmp/docassemble/Docker/*.sh /usr/share/docassemble/webapp/ \
&& cp /tmp/docassemble/Docker/VERSION /usr/share/docassemble/webapp/ \
&& cp /tmp/docassemble/Docker/pip.conf /usr/share/docassemble/local/ \
&& cp /tmp/docassemble/Docker/pip.conf /usr/share/docassemble/local3.6/ \
&& cp /tmp/docassemble/Docker/config/* /usr/share/docassemble/config/ \
&& cp /tmp/docassemble/Docker/cgi-bin/index.sh /usr/lib/cgi-bin/ \
&& cp /tmp/docassemble/Docker/syslog-ng.conf /usr/share/docassemble/webapp/syslog-ng.conf \
&& cp /tmp/docassemble/Docker/syslog-ng-docker.conf /usr/share/docassemble/webapp/syslog-ng-docker.conf \
&& cp /tmp/docassemble/Docker/docassemble-syslog-ng.conf /usr/share/docassemble/webapp/docassemble-syslog-ng.conf \
&& cp /tmp/docassemble/Docker/apache.logrotate /etc/logrotate.d/apache2 \
&& cp /tmp/docassemble/Docker/nginx.logrotate /etc/logrotate.d/nginx \
&& cp /tmp/docassemble/Docker/docassemble.logrotate /etc/logrotate.d/docassemble \
&& cp /tmp/docassemble/Docker/cron/docassemble-cron-monthly.sh /etc/cron.monthly/docassemble \
&& cp /tmp/docassemble/Docker/cron/docassemble-cron-weekly.sh /etc/cron.weekly/docassemble \
&& cp /tmp/docassemble/Docker/cron/docassemble-cron-daily.sh /etc/cron.daily/docassemble \
&& cp /tmp/docassemble/Docker/cron/docassemble-cron-hourly.sh /etc/cron.hourly/docassemble \
&& cp /tmp/docassemble/Docker/cron/syslogng-cron-daily.sh /etc/cron.daily/logrotatepost \
&& cp /tmp/docassemble/Docker/docassemble.conf /etc/apache2/conf-available/ \
&& cp /tmp/docassemble/Docker/docassemble-behindlb.conf /etc/apache2/conf-available/ \
&& cp /tmp/docassemble/Docker/docassemble-supervisor.conf /etc/supervisor/conf.d/docassemble.conf \
&& cp /tmp/docassemble/Docker/ssl/* /usr/share/docassemble/certs/ \
&& cp /tmp/docassemble/Docker/rabbitmq.config /etc/rabbitmq/ \
&& cp /tmp/docassemble/Docker/config/exim4-router /etc/exim4/conf.d/router/101_docassemble \
&& cp /tmp/docassemble/Docker/config/exim4-filter /etc/exim4/docassemble-filter \
&& cp /tmp/docassemble/Docker/config/exim4-main /etc/exim4/conf.d/main/01_docassemble \
&& cp /tmp/docassemble/Docker/config/exim4-acl /etc/exim4/conf.d/acl/29_docassemble \
&& cp /tmp/docassemble/Docker/config/exim4-update /etc/exim4/update-exim4.conf.conf \
&& update-exim4.conf \
&& chown www-data.www-data /usr/share/docassemble/config \
&& chown www-data.www-data \
/usr/share/docassemble/config/config.yml.dist \
/usr/share/docassemble/webapp/docassemble.wsgi \
&& chown -R www-data.www-data \
/tmp/docassemble \
/usr/share/docassemble/local \
/usr/share/docassemble/local3.6 \
/usr/share/docassemble/log \
/usr/share/docassemble/files \
&& chmod ogu+r /usr/share/docassemble/config/config.yml.dist \
&& chmod 755 /etc/ssl/docassemble \
&& cd /tmp \
&& wget https://bootstrap.pypa.io/get-pip.py \
&& python get-pip.py \
&& rm -f get-pip.py \
&& pip install --upgrade virtualenv \
&& echo \"en_US.UTF-8 UTF-8\" >> /etc/locale.gen \
&& locale-gen \
&& update-locale"
USER www-data
RUN LC_CTYPE=C.UTF-8 LANG=C.UTF-8 \
bash -c \
"cd /tmp \
&& virtualenv /usr/share/docassemble/local \
&& source /usr/share/docassemble/local/bin/activate \
&& pip install --upgrade pip \
&& pip install \
3to2==1.1.1 \
bcrypt==3.1.7 \
flask==1.1.1 \
flask-login==0.4.1 \
flask-mail==0.9.1 \
flask-sqlalchemy==2.4.0 \
flask-wtf==0.14.2 \
s4cmd==2.1.0 \
uwsgi==2.0.18 \
distutils2==1.0a4 \
passlib==1.7.1 \
pycrypto==2.6.1 \
six==1.12.0 \
&& pip install --upgrade \
'git+https://github.com/jhpyle/pdfminer.git' \
simplekv==0.10.0 \
/tmp/docassemble/docassemble \
/tmp/docassemble/docassemble_base \
/tmp/docassemble/docassemble_demo \
/tmp/docassemble/docassemble_webapp \
&& pip uninstall --yes mysqlclient MySQL-python &> /dev/null"
USER www-data
RUN LC_CTYPE=C.UTF-8 LANG=C.UTF-8 \
bash -c \
"cd /tmp \
&& python3.6 -m venv --copies /usr/share/docassemble/local3.6 \
&& source /usr/share/docassemble/local3.6/bin/activate \
&& pip3 install --upgrade pip \
&& pip3 install --upgrade mod_wsgi \
&& pip3 install --upgrade \
3to2==1.1.1 \
bcrypt==3.1.7 \
flask==1.1.1 \
flask-login==0.4.1 \
flask-mail==0.9.1 \
flask-sqlalchemy==2.4.1 \
flask-wtf==0.14.2 \
s4cmd==2.1.0 \
uwsgi==2.0.18 \
passlib==1.7.1 \
pycryptodome==3.9.0 \
pycryptodomex==3.9.0 \
six==1.12.0 \
setuptools==40.6.2 \
&& pip3 install --upgrade \
/tmp/docassemble/docassemble \
/tmp/docassemble/docassemble_base \
/tmp/docassemble/docassemble_demo \
/tmp/docassemble/docassemble_webapp \
&& pip3 uninstall --yes mysqlclient MySQL-python &> /dev/null"
USER root
RUN \
cp /usr/share/docassemble/local3.6/lib/python3.6/site-packages/mod_wsgi/server/mod_wsgi-py36.cpython-36m-x86_64-linux-gnu.so /usr/lib/apache2/modules/mod_wsgi.so-3.6 \
&& rm -rf /tmp/docassemble \
&& rm -f /etc/cron.daily/apt-compat \
&& sed -i -e 's/^\(daemonize\s*\)yes\s*$/\1no/g' -e 's/^bind 127.0.0.1/bind 0.0.0.0/g' /etc/redis/redis.conf \
&& sed -i -e 's/#APACHE_ULIMIT_MAX_FILES/APACHE_ULIMIT_MAX_FILES/' -e 's/ulimit -n 65536/ulimit -n 8192/' /etc/apache2/envvars \
&& sed -i '/session required pam_loginuid.so/c\#session required pam_loginuid.so' /etc/pam.d/cron \
&& LANG=en_US.UTF-8 \
&& a2dismod ssl; \
a2enmod rewrite; \
a2enmod xsendfile; \
a2enmod proxy; \
a2enmod proxy_http; \
a2enmod proxy_wstunnel; \
a2enmod headers; \
a2enconf docassemble; \
echo 'export TERM=xterm' >> /etc/bash.bashrc
EXPOSE 80 443 9001 514 25 465 8080 8081 5432 6379 4369 5671 5672 25672
ENV \
CONTAINERROLE="all" \
LOCALE="en_US.UTF-8 UTF-8" \
TIMEZONE="America/New_York" \
EC2="" \
S3ENABLE="" \
S3BUCKET="" \
S3ACCESSKEY="" \
S3SECRETACCESSKEY="" \
S3REGION="" \
DAHOSTNAME="" \
USEHTTPS="" \
USELETSENCRYPT="" \
LETSENCRYPTEMAIL="" \
BEHINDHTTPSLOADBALANCER="" \
DBHOST="" \
LOGSERVER="" \
REDIS="" \
RABBITMQ=""
CMD ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisor/supervisord.conf"]