Skip to content
Jakob Runge edited this page Nov 12, 2015 · 3 revisions

The postgres container

Executing postgres/run.sh starts an instance of postgres:9.3.10 passing it a postgres user and password. The container will run with a name of the form lingdb.postgres.$(date -I).$(pwgen 5 1). This makes sure that for every instance of the container we will know the date it was started and that containers from the same date have different names. If an exited container following that naming convention is found, the volumes of that container will be reused, so that the database is kept between updates and restarts. We only run version 9.3.10 of this container to make sure the lingdb.postgres.create and lingdb.postgres.backup containers are compatible with the postgres version. This is due to an issue where the ubuntu:latest image has an older postgresql client available than we want with postgres:latest.

The postgres/create container

build.sh

Executing postgres/create/build.sh creates the lingdb.postgres.create image on the base of ubuntu:latest by installing postgresql-client and adding create.sh as the entrypoint.

run.sh

postgres/create/run.sh executes the lingdb.postgres.create container linked against a running instance of lingdb.postgres. create.sh than creates the ielexdb201510 database and sets its ownership. If a postgres/create/dump.sql file is found that file will be inserted into the database.

The postgres/backup container

build.sh

Running postgres/backup/build.sh builds the lingdb.postgres.backup image on top of ubuntu:latest. It adds postgresql-client and backup.sh, which is also the entrypoint.

run.sh

postgres/backup/run.sh starts the lingdb.postgres.backup container linking it against a running lingdb.postgres container. The container will than produce backups by performing the steps described in backup.sh:

  • Create dump with current date
  • Delete all dumps except the last 10
  • Sleep 4 hours
Clone this wiki locally