The preferred way to deploy the dlang-tour on a production server is to use the Travis CI built docker image. To simplify container deployment it's recommended to use docker-compose.
The docker-compose.yml file contained
in this folder contains everything to orchestrate the
dlang-tour
on a server that meets the requirements below.
The Docker compose file also configures
watchtower
that checks periodically for updates on the latest
tag of the Docker image
and restarts the dlang-tour
container when a newer version is available.
- Linux with kernel >= 3.10.
- Docker installed on host system: >= 1.8.3
- Docker compose:
- Install Docker Compose
- To allow the dlang-tour container to start other containers on CentOS, the following SELinux module needs be installed beforehand: https://github.com/dpw/selinux-dockersock
- Make sure the docker daemon uses
overlay
storage driver as the defaultdevicemapper
driver fills your drive after some time.- Change
OPTIONS
in/etc/sysconfig/docker
:OPTIONS='--selinux-enabled=false -s overlay'
- Run
systemctl daemon-reload
- Run
systemctl restart docker
- Change
- Make sure that
docker-selinux
is installed in an up-to-date version.
- Checkout the repository featuring the latest
docker-compose.yml
:
git clone https://github.com/dlang-tour/core.git
cd core/deploy
- Adapt the environment variable
GOOGLE_ANALYTICS_ID
if needed indocker-compose.yml
. - Run
docker-compose up -d
. - Running
docker-compose logs tour
will show logfiles of the currently runningdlang-tour
container.
Copy docker_update.sh
to /etc/cron.daily/docker_update.sh
This is necessary to
- remove old, unused images
- remove left-overs containers (Docker
--rm
isn't perfect) - update the execution images (the watchtower only updates the base docker container)