2017-03-08 13:55:02 +01:00
|
|
|
FROM armadillica/pillar_py:3.6
|
2018-08-30 11:37:53 +02:00
|
|
|
LABEL maintainer="Sybren A. Stüvel <sybren@blender.studio>"
|
2016-08-10 18:27:27 +02:00
|
|
|
|
2018-08-30 11:37:53 +02:00
|
|
|
RUN set -ex; \
|
|
|
|
apt-get update; \
|
|
|
|
DEBIAN_FRONTEND=noninteractive apt-get install -qy \
|
|
|
|
-o APT::Install-Recommends=false -o APT::Install-Suggests=false \
|
|
|
|
git \
|
|
|
|
apache2 \
|
|
|
|
libapache2-mod-xsendfile \
|
|
|
|
libjpeg8 \
|
|
|
|
libtiff5 \
|
|
|
|
ffmpeg \
|
|
|
|
rsyslog logrotate \
|
|
|
|
nano vim-tiny curl; \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
2016-08-10 18:27:27 +02:00
|
|
|
|
2017-03-08 12:34:48 +01:00
|
|
|
RUN ln -s /usr/bin/vim.tiny /usr/bin/vim
|
|
|
|
|
2016-08-10 18:27:27 +02:00
|
|
|
ENV APACHE_RUN_USER www-data
|
|
|
|
ENV APACHE_RUN_GROUP www-data
|
|
|
|
ENV APACHE_LOG_DIR /var/log/apache2
|
|
|
|
ENV APACHE_PID_FILE /var/run/apache2.pid
|
|
|
|
ENV APACHE_RUN_DIR /var/run/apache2
|
|
|
|
ENV APACHE_LOCK_DIR /var/lock/apache2
|
|
|
|
|
|
|
|
RUN mkdir -p $APACHE_RUN_DIR $APACHE_LOCK_DIR $APACHE_LOG_DIR
|
|
|
|
|
|
|
|
ADD wheelhouse /data/wheelhouse
|
2017-03-07 22:41:05 +01:00
|
|
|
RUN pip3 install --no-index --find-links=/data/wheelhouse -r /data/wheelhouse/requirements.txt
|
2016-08-10 18:27:27 +02:00
|
|
|
|
|
|
|
VOLUME /data/config
|
|
|
|
VOLUME /data/storage
|
2017-05-17 10:07:40 +02:00
|
|
|
VOLUME /var/log
|
2016-08-10 18:27:27 +02:00
|
|
|
|
|
|
|
ENV USE_X_SENDFILE True
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
EXPOSE 5000
|
|
|
|
|
2018-03-23 12:12:39 +01:00
|
|
|
ADD apache/wsgi-py36.* /etc/apache2/mods-available/
|
2017-03-08 12:35:35 +01:00
|
|
|
RUN a2enmod rewrite && a2enmod wsgi-py36
|
|
|
|
|
2018-03-23 12:12:39 +01:00
|
|
|
ADD apache/apache2.conf /etc/apache2/apache2.conf
|
|
|
|
ADD apache/000-default.conf /etc/apache2/sites-available/000-default.conf
|
|
|
|
ADD apache/logrotate.conf /etc/logrotate.d/apache2
|
2017-06-02 10:54:46 +02:00
|
|
|
ADD *.sh /
|
2016-08-10 18:27:27 +02:00
|
|
|
|
2017-03-08 12:35:35 +01:00
|
|
|
# Remove some empty top-level directories we won't use anyway.
|
|
|
|
RUN rmdir /media /home 2>/dev/null || true
|
|
|
|
|
|
|
|
# This file includes some useful commands to have in the shell history
|
|
|
|
# for easy access.
|
|
|
|
ADD bash_history /root/.bash_history
|
|
|
|
|
|
|
|
ENTRYPOINT /docker-entrypoint.sh
|
2018-02-02 12:09:16 +01:00
|
|
|
|
|
|
|
# Add the most-changing files as last step for faster rebuilds.
|
|
|
|
ADD config_local.py /data/git/blender-cloud/
|
2019-02-13 10:39:18 +01:00
|
|
|
ADD staging /data/git
|
2018-03-23 17:25:47 +01:00
|
|
|
RUN python3 -c "import re, secrets; \
|
|
|
|
f = open('/data/git/blender-cloud/config_local.py', 'a'); \
|
|
|
|
h = re.sub(r'[_.~-]', '', secrets.token_urlsafe())[:8]; \
|
|
|
|
print(f'STATIC_FILE_HASH = {h!r}', file=f)"
|