Dockerfile 2.97 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
14
15
16
17
	&& for i in $(seq 1 3); do \
              gpg --keyserver ipv4.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
              && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
              && break || sleep 5; \
           done\
18
	&& rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc \
19
	&& chmod +x /usr/local/bin/gosu
20

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

23
24
25
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
26
run cd /usr/share/vidjil/server && make download_web2py && unzip web2py_src.zip && unlink web2py_src.zip
27

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

33
34
arg build_env='PRODUCTION'
env BUILD_ENV $build_env
35
36

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

43
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
44

45
copy ./scripts/uwsgi-entrypoint.sh /entrypoints/uwsgi-entrypoint.sh
46
copy ./scripts/fuse-entrypoint.sh /entrypoints/fuse-entrypoint.sh
47
run mkdir /usr/share/vidjil/server/web2py/applications/vidjil/databases && touch /usr/share/vidjil/server/web2py/applications/vidjil/databases/sql.log
48
run mkdir /var/vidjil
49
run touch /var/vidjil/vidjil.log && touch /var/vidjil/vidjil-debug.log
50
run PASSWORD=`openssl rand -base64 10` && cd /usr/share/vidjil/server/web2py && python -c "from gluon.main import save_password; save_password('${PASSWORD}',443)"
51
run chown -R www-data:www-data /usr/share/vidjil
52
run useradd -ms /bin/bash vidjil && usermod -aG sudo vidjil