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
overlaystorage driver as the defaultdevicemapperdriver fills your drive after some time.- Change
OPTIONSin/etc/sysconfig/docker:OPTIONS='--selinux-enabled=false -s overlay' - Run
systemctl daemon-reload - Run
systemctl restart docker
- Change
- Make sure that
docker-selinuxis 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_IDif needed indocker-compose.yml. - Run
docker-compose up -d. - Running
docker-compose logs tourwill show logfiles of the currently runningdlang-tourcontainer.
Copy docker_update.sh to /etc/cron.daily/docker_update.sh
This is necessary to
- remove old, unused images
- remove left-overs containers (Docker
--rmisn't perfect) - update the execution images (the watchtower only updates the base docker container)