Dockerfile 2.9 KB
Newer Older
1
from ubuntu:18.04
2

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

7
env GOSU_VERSION 1.10
8
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 python-ijson libyajl2 python-cffi gnupg2 && rm -rf /var/lib/apt/lists/* \
10 11 12
	&& 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)" \
13
	&& gpg --keyserver ipv4.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
14 15
	&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
	&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
16
	&& chmod +x /usr/local/bin/gosu
17

18
run apt-get update ; apt-get install --no-install-recommends --no-install-suggests -y -q sudo curl apt-utils uwsgi-plugin-python
19

20 21 22
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
23
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
24

25 26 27
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
28
copy ./conf/base.py /usr/share/vidjil/server/web2py/gluon/packages/dal/pydal/base.py
29

30 31
arg build_env='PRODUCTION'
env BUILD_ENV $build_env
32 33

copy ./conf/uwsgi.ini /etc/uwsgi/apps-enabled/web2py.ini
34
run mkdir /etc/vidjil
Ryan Herbert's avatar
Ryan Herbert committed
35
copy ./conf/wsgihandler.py /etc/vidjil/wsgihandler.py
Ryan Herbert's avatar
Ryan Herbert committed
36
run chmod +x /opt/install_scripts/install.sh; sync && /opt/install_scripts/install.sh
37
run ln -s /etc/vidjil/defs.py /usr/share/vidjil/server/web2py/applications/vidjil/modules/defs.py
Ryan Herbert's avatar
Ryan Herbert committed
38
run ln -s /etc/vidjil/wsgihandler.py /usr/share/vidjil/server/web2py/wsgihandler.py
39

40
run wget http://www.vidjil.org/releases/vidjil-latest_x86_64 && mv vidjil-latest_x86_64 /usr/share/vidjil/vidjil-algo && cd /usr/share/vidjil/ && chmod +x vidjil-algo
41

42
copy ./scripts/uwsgi-entrypoint.sh /entrypoints/uwsgi-entrypoint.sh
43
copy ./scripts/fuse-entrypoint.sh /entrypoints/fuse-entrypoint.sh
44
run mkdir /usr/share/vidjil/server/web2py/applications/vidjil/databases && touch /usr/share/vidjil/server/web2py/applications/vidjil/databases/sql.log
45
run mkdir /var/vidjil
46
run touch /var/vidjil/vidjil.log && touch /var/vidjil/vidjil-debug.log
47
run cd /usr/share/vidjil/server/web2py && python -c "from gluon.main import save_password; save_password('default',443)"
48
run chown -R www-data:www-data /usr/share/vidjil
49
run useradd -ms /bin/bash vidjil && usermod -aG sudo vidjil