DaCHS on Docker
Check the documents directory (docs/) for (practical) notes on
- versioning your resources,
- persisting data,
- upgrading DaCHS,
- running dachs and_postgresql individually.
This repository contains the dockerfiles for GAVO DaCHS. You'll find the corresponding images in 'chbrandt/dachs' DockerHub repository. DaCHS (or suite) is composed by a Postgres server in the background managed by the dachs-server which interfaces the database to the user.
The dockerfiles in here will setup image families (with their respective tags):
chbrandt/dachs: DaCHS server + Postgres db -- used for testing only
chbrandt/dachs:server: the DaCHS data-manager/server suite
chbrandt/dachs:postgres: the Postgres db used by DaCHS
In this document we'll see how to run Dachs-on-Docker, the containerized version of DaCHS.
Command-lines running from the host system are prefixed by
(dock)are run from inside the container.
- Docker image tags:
latest (default) image is composed by dachs-server and postgresql,
running on the same container.
You run it by mapping the container's port (8080) to some on your host:
(host)$ docker run -it --name dachs -p 80:8080 chbrandt/dachs
, where we mapped the host's port
80 to container's
Dachs settings included in this image are in bundle/etc.
Inside the container, to start the services work like in a normal machine:
(dock)$ service postgresql start (dock)$ service dachs start
. You can also use a convenience
dachs.sh script to start postgresql for you:
(dock)$ /dachs.sh start
Go to your host's 'http://localhost' to check DaCHS web interface.
To make a directory from the host system available from the container one can
use the option argument '
-v' to mount a volume at given location inside
(host)$ docker run -it --name dachs -p 80:8080 \ -v /data/inputs/resourceX:/var/gavo/inputs/resourceX \ chbrandt/dachs
You can mount as many volumes (directories) as you want.
Inside the container, you can use dachs as you would on an usual machine. For instance, run DaCHS and load/pub "resourceX":
(dock)$ service postgresql start (dock)$ service dachs start (dock)$ (dock)$ cd /var/gavo/inputs (dock)$ gavo imp resourceX/q.rd (dock)$ gavo pub resourceX/q.rd (dock)$ (dock)$ service dachs reload
If you're using the container to test a new version to eventually migrate your
database, you'll likely want to mount your VO/DaCHS resources as in the example
above. To add security to your data -- if they are being shared with the data
resource live in production -- you may want to use '
ro' (read-only) as an
option for mounting points:
(host)$ docker run -v /data/rd/input:/var/gavo/inputs/input:ro \ -it --name dachs -p 80:8080 \ chbrandt/dachs
And then do the imports, publications, data access tests necessary to check for compatibility; and eventually migrate to the new version if/when everything is fine.
- Docker image tags:
DaCHS' version 2 is available as a beta version, which runs on Python-3. Because it is a major upgrade dachs has gone through, it is a good idea to test your data and services as extensively as possible.
To use the new version, just have to use the
(host)$ docker run -v /data/rd/input:/var/gavo/inputs/input:ro \ -it --name dachs -p 80:8080 \ chbrandt/dachs:beta
Everything should feel the same.
Start docker (here through the convenience script left in your container's '
and use/test it as usual:
(dock)$ /dachs.sh start 9.6/main (port 5432): down [ ok ] Starting PostgreSQL 9.6 database server: main. [ ok ] Starting VO server: dachs. (dock)$ (dock)$ dachs --version Software (2.0.4) Schema (23/23)
This repository structure
This Github repository has four branches,
master branch has the Dockerfile for the
latest (aka, bundle) docker image.
postgres have the Dockerfiles for the individual containers.
DaCHS-on-Docker image:tag sets for
chbrandt/dachs, available at Docker Hub:
|git branch||docker image|