From 46e85324df762672718c0a6a5ca60fb247e89e5d Mon Sep 17 00:00:00 2001 From: Markus Witt Date: Sun, 21 Apr 2019 23:13:03 +0200 Subject: docker: add docker-compose configuration MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🔥docker🔥compose🔥 --- examples/docker/postgres-init.sh | 8 ++++++++ examples/docker/travelynx.conf | 26 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 examples/docker/postgres-init.sh create mode 100644 examples/docker/travelynx.conf (limited to 'examples') diff --git a/examples/docker/postgres-init.sh b/examples/docker/postgres-init.sh new file mode 100644 index 0000000..a8c59d1 --- /dev/null +++ b/examples/docker/postgres-init.sh @@ -0,0 +1,8 @@ +#!/bin/sh +set -e + +psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL + CREATE USER ${TRAVELYNX_DB_USERNAME} PASSWORD '${TRAVELYNX_DB_PASSWORD}'; + CREATE DATABASE ${TRAVELYNX_DB_NAME}; + GRANT ALL PRIVILEGES ON DATABASE ${TRAVELYNX_DB_NAME} TO ${TRAVELYNX_DB_USERNAME}; +EOSQL \ No newline at end of file diff --git a/examples/docker/travelynx.conf b/examples/docker/travelynx.conf new file mode 100644 index 0000000..8f3f56f --- /dev/null +++ b/examples/docker/travelynx.conf @@ -0,0 +1,26 @@ +{ + cache => { + schedule => $ENV{TRAVELYNX_IRIS_CACHE} // '/var/cache/travelynx/iris', + realtime => $ENV{TRAVELYNX_IRISRT_CACHE} // '/var/cache/travelynx/iris-rt', + }, + db => { + host => $ENV{TRAVELYNX_DB_HOST} // 'die("Please set TRAVELYNX_DB_HOST")', + database => $ENV{TRAVELYNX_DB_NAME} // 'travelynx', + user => $ENV{TRAVELYNX_DB_USERNAME} // 'travelynx', + password => $ENV{TRAVELYNX_DB_PASSWORD} // die("Please set TRAVELYNX_DB_PASSWORD"), + }, + hypnotoad => { + accepts => $ENV{TRAVELYNX_HYPNOTOAD_ACCEPTS} // 100, + clients => $ENV{TRAVELYNX_HYPNOTOAD_CLIENTS} // 10, + listen => [ $ENV{TRALELYNX_HYPNOTOAD_LISTEN} // 'http://*:8093' ], + pid_file => '/tmp/travelynx.pid', + workers => $ENV{TRAVELYNX_HYPNOTOAD_WORKERS} // 2, + spare => $ENV{TRAVELYNX_HYPNOTOAD_SPARE} // 2, + }, + mail => { + disabled => $ENV{TRAVELYNX_MAIL_DISABLE} // 0, + }, + secrets => [ + $ENV{TRAVELYNX_SECRET} // die("Please set TRAVELYNX_SECRET"), + ], +}; -- cgit v1.2.3 From a1a0f33cab731eb60051af6bd5ae78cd6660b76f Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Sun, 5 May 2019 11:22:19 +0200 Subject: travelynx.conf: Actually call die() if DB_HOST is unset --- examples/docker/travelynx.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/docker/travelynx.conf b/examples/docker/travelynx.conf index 8f3f56f..b3dc003 100644 --- a/examples/docker/travelynx.conf +++ b/examples/docker/travelynx.conf @@ -4,7 +4,7 @@ realtime => $ENV{TRAVELYNX_IRISRT_CACHE} // '/var/cache/travelynx/iris-rt', }, db => { - host => $ENV{TRAVELYNX_DB_HOST} // 'die("Please set TRAVELYNX_DB_HOST")', + host => $ENV{TRAVELYNX_DB_HOST} // die("Please set TRAVELYNX_DB_HOST"), database => $ENV{TRAVELYNX_DB_NAME} // 'travelynx', user => $ENV{TRAVELYNX_DB_USERNAME} // 'travelynx', password => $ENV{TRAVELYNX_DB_PASSWORD} // die("Please set TRAVELYNX_DB_PASSWORD"), -- cgit v1.2.3