Dockerfile 3.39 KB
Newer Older
1 2
from ubuntu:16.04

3
label version="1.1"
4 5 6 7 8
label description="An Ubuntu based docker image which comes \
with a full installation of the Vidjil algoright and browser/server."

env GOSU_VERSION 1.7
run set -x \
9
	&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget cron unzip make python ipython python-enum34 python-requests git && rm -rf /var/lib/apt/lists/* \
10 11 12 13 14 15 16
	&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \
	&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \
	&& export GNUPGHOME="$(mktemp -d)" \
	&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
	&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
	&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
	&& chmod +x /usr/local/bin/gosu \
17 18
	&& apt-get purge -y --auto-remove ca-certificates

19
run apt-get update ; apt-get install --no-install-recommends --no-install-suggests -y -q sudo curl apt-utils uwsgi-plugin-python nginx-full fcgiwrap
20

21 22 23
arg git_branch=dev
arg remote_repo=https://gitlab.inria.fr/vidjil/vidjil.git
run cd /usr/share/ && git config --global http.sslVerify false && git clone -b $git_branch $remote_repo
24
run cd /usr/share/vidjil/server && wget --no-check-certificate https://mdipierro.pythonanywhere.com/examples/static/web2py_src.zip && unzip web2py_src.zip && unlink web2py_src.zip
25 26 27

run cd /usr/share/vidjil/germline && make

28 29
#run ln -sf /dev/stdout /var/log/nginx/access.log \
#	&& ln -sf /dev/stderr /var/log/nginx/error.log
30

31 32
copy ./conf/nginx_gzip_static.conf /etc/nginx/conf.d/web2py/gzip_static.conf
copy ./conf/nginx_gzip.conf /etc/nginx/conf.d/web2py/gzip.conf
33
copy ./conf/uwsgi.conf /etc/nginx/conf.d/web2py/uwsgi.conf
34 35 36 37 38 39 40 41 42
add ./scripts/install.sh /opt/install_scripts/install.sh
copy ./conf/defs.py /opt/vidjil_conf/defs.py
copy ./conf/defs_http.py /opt/vidjil_conf/defs_http.py
copy ./conf/conf.js /opt/vidjil_conf/conf.js
copy ./conf/conf_http.js /opt/vidjil_conf/conf_http.js
copy ./conf/nginx_web2py /opt/vidjil_conf/web2py
copy ./conf/nginx_web2py_http /opt/vidjil_conf/web2py_http
copy ./conf/Gemfile /usr/share/vidjil/Gemfile

43 44
run cd /usr/share/vidjil/browser/css/icons && make

45 46
arg build_env='PRODUCTION'
env BUILD_ENV $build_env
47 48

copy ./conf/uwsgi.ini /etc/uwsgi/apps-enabled/web2py.ini
49
run mkdir /etc/vidjil
50
copy ./conf/wsgihandler.py /etc/vidjil/wsgihandler.py
51
run chmod +x /opt/install_scripts/install.sh && /opt/install_scripts/install.sh
52 53
run ln -s /etc/vidjil/defs.py /usr/share/vidjil/server/web2py/applications/vidjil/modules/defs.py
run ln -s /etc/vidjil/conf.js /usr/share/vidjil/browser/js/conf.js
54
run ln -s /etc/vidjil/wsgihandler.py /usr/share/vidjil/server/web2py/wsgihandler.py
55

56 57
copy ./scripts/nginx-entrypoint.sh /entrypoints/nginx-entrypoint.sh
copy ./scripts/uwsgi-entrypoint.sh /entrypoints/uwsgi-entrypoint.sh
58
copy ./scripts/fuse-entrypoint.sh /entrypoints/fuse-entrypoint.sh
59
run mkdir /usr/share/vidjil/server/web2py/applications/vidjil/databases && touch /usr/share/vidjil/server/web2py/applications/vidjil/databases/sql.log
60
run mkdir /var/vidjil
61
run touch /var/vidjil/vidjil.log && touch /var/vidjil/vidjil-debug.log
62
run useradd -ms /bin/bash vidjil && usermod -aG sudo vidjil
63 64

run cd /usr/share/vidjil/server/web2py && python -c "from gluon.main import save_password; save_password('default',443)"