Commit cd5aa26b authored by HERBERT Ryan's avatar HERBERT Ryan Committed by Mathieu Giraud

Adding dockerfiles and docker documentation

parent fdf10a81
......@@ -469,3 +469,63 @@ make functional
You're done! You can now install the debian package with:
$ sudo dpkg -i path/to/package
* Docker
** Building the necessary images
The vidjil docker image is built on an Ubuntu image equipped with systemd.
This is a custom image for which the Dockerfile can be found in
In order to build the vidjil_ubuntu image, simply run
$ docker build -t ubuntu_systemd .
from the ubuntu_systemd directory. And then
$ docker build -t vidjil_ubuntu .
** Starting a Vidjil docker environment
Traditionnally the Vidjil Team uses a MySQL database to store user data,
so in this guide we will cover setting up a MySQL Docker alongside the Vidjil Docker.
Start the mysql container. If the tagged version is not available locally it will be pulled automatically:
$ docker run --name <mysql-name> -e MYSQL_ROOT_PASSWORD=<my-secret-pw> -d mysql/mysql-server:<tag>
Get the container's ip address:
$ docker inspect <mysql-name> | grep -i ip
Setup the vidjil databse:
$ mysql -h <container-ip> -u root -p
$ create database <vidjil-database>;
$ create user <vidjil-user>;
$ grant all on <vidjil-database>.* to '<vidjil-user>'@'%';
$ set password for '<vidjil-user>'@'%' = PASSWORD('<vidjil-user-password>');
Exit the MySQL interface and edit your local file to match the newly created database:
$ DB_ADDRESS = 'mysql://<vidjil-user>:<vidjil-user-password>@<mysql-conainer-ip>/<vidjil-database>'
Start the vidjil Docker:
$ docker run --name <vidjil-container-name>\
--link <mysql-name>:mysql\
-v /sys/fs/cgroup:/sys/fs/cgroup:ro\
-v <path-to-defs>:/etc/vidjil/\
-p 80:80\
-p 443:443\
Make sure it works:
$ curl http://localhost/browser
$ curl https://localhost/vidjil
** Configuring the Vidjil container
Should you wish to further customise your vidjil environment, most configuration files are located in /etc/vidjil/.
Here is a list of thos files:
apache_web2py configuration required when running vidjil with apache2
conf.js contains various variables for the vidjil browser contains various variables for the vidjil server
nginx_gzip.conf configuration for gzip in nginx
nginx_gzip_static.conf same as the previous but for static ressources
nginx_web2py configuration required when running vidjil with nginx
systemd_fuse_server.service systemd service that starts the vidjil fuse server
systemd_web2py_scheduler.service systemd service that starts the vidjil scheduler workers
uwsgi.ini configuration required to run vidjil with uwsgi
FROM ubuntu:16.04
ENV container docker
ENV DEBIAN_FRONTEND noninteractive
RUN echo 'APT::Install-Recommends "0"; \n\
APT::Get::Assume-Yes "true"; \n\
APT::Get::force-yes "true"; \n\
APT::Install-Suggests "0";' > /etc/apt/apt.conf.d/01buildconfig
RUN mkdir -p /etc/apt/sources.d/
RUN echo "deb mirror:// vivid main restricted universe multiverse \n\
deb mirror:// vivid-updates main restricted universe multiverse \n\
deb mirror:// vivid-backports main restricted universe multiverse \n\
deb mirror:// vivid-security main restricted universe multiverse" > /etc/apt/sources.d/ubuntu-mirrors.list
RUN apt-get update && apt-get install systemd
RUN (cd /lib/systemd/system/; for i in *; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); \
rm -f /lib/systemd/system/*;\
rm -f /etc/systemd/system/*.wants/*;\
rm -f /lib/systemd/system/*; \
rm -f /lib/systemd/system/*udev*; \
rm -f /lib/systemd/system/*initctl*; \
rm -f /lib/systemd/system/*;\
rm -f /lib/systemd/system/*; \
rm -f /lib/systemd/system/plymouth*; \
rm -f /lib/systemd/system/systemd-update-utmp*;
RUN systemctl set-default
ENV init /lib/systemd/systemd
VOLUME [ "/sys/fs/cgroup" ]
# docker run -it --privileged=true -v /sys/fs/cgroup:/sys/fs/cgroup:ro 444c127c995b /lib/systemd/systemd systemd.unit=emergency.service
ENTRYPOINT ["/lib/systemd/systemd"]
CMD ["systemd.unit=emergency.service"]
from ubuntu_systemd
label version="1.0"
label description="An Ubuntu based docker image which comes \
with a full installation of the Vidjil algoright and browser/server."
run apt-get update
run apt-get -y -q install apt-utils sudo curl nginx-full
run echo deb sid/all/ >> /etc/apt/sources.list
run echo deb sid/amd64/ >> /etc/apt/sources.list
run echo deb wheezy/all/ >> /etc/apt/sources.list
run echo deb wheezy/amd64/ >> /etc/apt/sources.list
# Install Postfix. Shamelessly stolen from
run echo "postfix postfix/main_mailer_type string Internet site" > preseed.txt
run echo "postfix postfix/mailname string" >> preseed.txt
# Use Mailbox format.
run debconf-set-selections preseed.txt
run DEBIAN_FRONTEND=noninteractive apt-get install -q -y postfix
run postconf -e
run postconf -e mydestination=",, localhost.localdomain, localhost"
run postconf -e mail_spool_directory="/var/spool/mail/"
run postconf -e mailbox_command=""
run echo "vidjil-server vidjil/reconfigure-webserver string nginx" > preseed.txt
run echo "vidjil-server vidjil/restart-webserver boolean true" >> preseed.txt
run echo "vidjil-server vidjil/configure-startup string systemd" >> preseed.txt
run echo "vidjil-server vidjil/start-services boolean false" >> preseed.txt
run echo "vidjil-server vidjil/web2py-password string VidjilAdm1n" >> preseed.txt
run echo "vidjil-server vidjil/ssl-country string AU" >> preseed.txt
run echo "vidjil-server vidjil/ssl-state string Some-State" >> preseed.txt
run echo "vidjil-server vidjil/ssl-locality string Some-Locality" >> preseed.txt
run echo "vidjil-server vidjil/ssl-organisation string Internet Widgits Pty Ltd" >> preseed.txt
run echo "vidjil-server vidjil/ssl-section string Some-Section" >> preseed.txt
run echo "vidjil-server vidjil/ssl-name string VidjilTeam" >> preseed.txt
run echo "vidjil-server vidjil/ssl-email string" >> preseed.txt
run debconf-set-selections preseed.txt
run echo >> /etc/hosts ;\
gpg --recv-key --keyserver 9187987418E1A625 ;\
apt-get update ;\
DEBIAN_FRONTEND=noninteractive apt-get -y -q --allow-unauthenticated install vidjil-archive-keyring ;\
apt-get update ;\
DEBIAN_FRONTEND=noninteractive apt-get install -y -q --allow-unauthenticated vidjil-server
run cd /usr/share/vidjil/germline && make
run cd /usr/share/web2py && chown -R www-data:www-data .
run systemctl enable web2py.scheduler.service fuse.server.service
cmd ["/bin/systemctl", "start", "nginx.service"]
cmd ["/bin/systemctl", "start", "uwsgi.service"]
expose 80
expose 443
cmd ["/usr/sbin/init"]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment