Use fixed Docker hostnames

This commit is contained in:
Disassembler 2018-01-15 21:51:15 +01:00
parent 5d1eb43648
commit c8a3dc0b0e
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
21 changed files with 30 additions and 30 deletions

View File

@ -8,7 +8,7 @@ depend() {
}
start() {
/usr/bin/docker run -d --rm --name ckan-datapusher -p 127.0.0.1:9004:8004 -v /srv/ckan-datapusher/conf:/etc/ckan-datapusher -v /srv/ckan-datapusher/data:/srv/ckan-datapusher/data ckan-datapusher
/usr/bin/docker run -d --rm --name ckan-datapusher -h ckan-datapusher -p 127.0.0.1:9004:8004 -v /srv/ckan-datapusher/conf:/etc/ckan-datapusher -v /srv/ckan-datapusher/data:/srv/ckan-datapusher/data ckan-datapusher
}
stop() {

View File

@ -28,9 +28,9 @@ cp ${SOURCE_DIR}/srv/ckan/update-ip.sh /srv/ckan/update-ip.sh
/srv/ckan/update-ip.sh
# Populate database
docker run --rm --link=postgres --link=redis --link=solr -v /srv/ckan/conf:/etc/ckan -v /srv/ckan/data:/srv/ckan/storage ckan paster --plugin=ckan db init -c /etc/ckan/ckan.ini
docker run --rm --link=postgres --link=redis --link=solr -v /srv/ckan/conf:/etc/ckan -v /srv/ckan/data:/srv/ckan/storage ckan paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan.ini
docker run --rm --link=postgres --link=redis --link=solr -v /srv/ckan/conf:/etc/ckan -v /srv/ckan/data:/srv/ckan/storage ckan paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | docker exec -i postgres psql
docker run --rm -h ckan --link=postgres --link=redis --link=solr -v /srv/ckan/conf:/etc/ckan -v /srv/ckan/data:/srv/ckan/storage ckan paster --plugin=ckan db init -c /etc/ckan/ckan.ini
docker run --rm -h ckan --link=postgres --link=redis --link=solr -v /srv/ckan/conf:/etc/ckan -v /srv/ckan/data:/srv/ckan/storage ckan paster --plugin=ckanext-spatial spatial initdb -c /etc/ckan/ckan.ini
docker run --rm -h ckan --link=postgres --link=redis --link=solr -v /srv/ckan/conf:/etc/ckan -v /srv/ckan/data:/srv/ckan/storage ckan paster --plugin=ckan datastore set-permissions -c /etc/ckan/ckan.ini | docker exec -i postgres psql
# Create admin account
export CKAN_ADMIN_USER="admin"

View File

@ -13,7 +13,7 @@ start_pre() {
}
start() {
/usr/bin/docker run -d --rm --name ckan --link=postgres --link=redis --link=solr --link=ckan-datapusher -p 127.0.0.1:9003:8003 -v /srv/ckan/conf:/etc/ckan -v /srv/ckan/data:/srv/ckan/storage ckan
/usr/bin/docker run -d --rm --name ckan -h ckan --link=postgres --link=redis --link=solr --link=ckan-datapusher -p 127.0.0.1:9003:8003 -v /srv/ckan/conf:/etc/ckan -v /srv/ckan/data:/srv/ckan/storage ckan
}
stop() {

View File

@ -12,7 +12,7 @@ envsubst <${SOURCE_DIR}/createdb.sql | docker exec -i postgres psql
# Copy existing config files into persistent storage
mkdir -p /srv/crisiscleanup/conf
chown 8005:8005 /srv/crisiscleanup/conf
docker run --rm -v /srv/crisiscleanup/conf:/mnt/conf crisiscleanup cp -rp /srv/crisiscleanup/config/. /mnt/conf
docker run --rm -h crisiscleanup -v /srv/crisiscleanup/conf:/mnt/conf crisiscleanup cp -rp /srv/crisiscleanup/config/. /mnt/conf
chown root:root /srv/crisiscleanup/conf
# Configure CrisisCleanup
@ -26,8 +26,8 @@ cp ${SOURCE_DIR}/srv/crisiscleanup/conf/environments/production.rb /srv/crisiscl
# Populate database
envsubst <${SOURCE_DIR}/srv/crisiscleanup/db/seeds.rb >/tmp/seeds.rb
docker run --rm --link=postgres -v /srv/crisiscleanup/conf:/srv/crisiscleanup/config crisiscleanup rake db:schema:load
docker run --rm --link=postgres -v /srv/crisiscleanup/conf:/srv/crisiscleanup/config -v /tmp/seeds.rb:/srv/crisiscleanup/db/seeds.rb crisiscleanup rake db:seed
docker run --rm -h crisiscleanup --link=postgres -v /srv/crisiscleanup/conf:/srv/crisiscleanup/config crisiscleanup rake db:schema:load
docker run --rm -h crisiscleanup --link=postgres -v /srv/crisiscleanup/conf:/srv/crisiscleanup/config -v /tmp/seeds.rb:/srv/crisiscleanup/db/seeds.rb crisiscleanup rake db:seed
rm /tmp/seeds.rb
# Create CrisisCleanup service

View File

@ -9,7 +9,7 @@ depend() {
}
start() {
/usr/bin/docker run -d --rm --name crisiscleanup --link=postgres -p 127.0.0.1:9005:8005 -v /srv/crisiscleanup/conf:/srv/crisiscleanup/config crisiscleanup
/usr/bin/docker run -d --rm --name crisiscleanup -h crisiscleanup --link=postgres -p 127.0.0.1:9005:8005 -v /srv/crisiscleanup/conf:/srv/crisiscleanup/config crisiscleanup
}
stop() {

6
cts.sh
View File

@ -12,7 +12,7 @@ envsubst <${SOURCE_DIR}/createdb.sql | docker exec -i postgres psql
# Copy existing config files into persistent storage
mkdir -p /srv/cts/conf
chown 8006:8006 /srv/cts/conf
docker run --rm -v /srv/cts/conf:/mnt/conf cts cp -rp /srv/cts/cts/settings/. /mnt/conf
docker run --rm -h cts -v /srv/cts/conf:/mnt/conf cts cp -rp /srv/cts/cts/settings/. /mnt/conf
chown -R root:root /srv/cts/conf
# Configure CTS
@ -25,12 +25,12 @@ if [ ${DEBUG:-0} -eq 0 ]; then
fi
# Populate database
docker run --rm --link=postgres -v /srv/cts/conf:/srv/cts/cts/settings cts manage.py migrate
docker run --rm -h cts --link=postgres -v /srv/cts/conf:/srv/cts/cts/settings cts manage.py migrate
# Create admin account
export CTS_ADMIN_EMAIL=admin@example.com
export CTS_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export CTS_ADMIN_HASH=$(docker run --rm -v /srv/cts/conf:/srv/cts/cts/settings cts python -c "from django.contrib.auth.hashers import make_password; print make_password('${CTS_ADMIN_PWD}')")
export CTS_ADMIN_HASH=$(docker run --rm -h cts -v /srv/cts/conf:/srv/cts/cts/settings cts python -c "from django.contrib.auth.hashers import make_password; print make_password('${CTS_ADMIN_PWD}')")
export CTS_ADMIN_SECRET=$(head -c 12 /dev/urandom | sha256sum | cut -c1-13)
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql cts

View File

@ -9,7 +9,7 @@ depend() {
}
start() {
/usr/bin/docker run -d --rm --name cts --link=postgres -p 127.0.0.1:9006:8006 -v /srv/cts/conf:/srv/cts/cts/settings cts
/usr/bin/docker run -d --rm --name cts -h cts --link=postgres -p 127.0.0.1:9006:8006 -v /srv/cts/conf:/srv/cts/cts/settings cts
}
stop() {

View File

@ -16,7 +16,7 @@ envsubst <${SOURCE_DIR}/srv/gnuhealth/conf/trytond.conf >/srv/gnuhealth/conf/try
# Populate database
export GNUHEALTH_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
echo ${GNUHEALTH_ADMIN_PWD} >/tmp/.adminpwd
docker run --rm --link=postgres -v /srv/gnuhealth/conf:/srv/gnuhealth/gnuhealth/tryton/server/config -v /tmp/.adminpwd:/tmp/.adminpwd -e TRYTONPASSFILE=/tmp/.adminpwd gnuhealth /srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.8/bin/trytond-admin -d gnuhealth --all -v
docker run --rm -h gnuhealth --link=postgres -v /srv/gnuhealth/conf:/srv/gnuhealth/gnuhealth/tryton/server/config -v /tmp/.adminpwd:/tmp/.adminpwd -e TRYTONPASSFILE=/tmp/.adminpwd gnuhealth /srv/gnuhealth/gnuhealth/tryton/server/trytond-4.2.8/bin/trytond-admin -d gnuhealth --all -v
rm -f /tmp/.adminpwd
# Populate demo database

View File

@ -9,7 +9,7 @@ depend() {
}
start() {
/usr/bin/docker run -d --rm --name gnuhealth --link=postgres -p 127.0.0.1:9008:8008 -v /srv/gnuhealth/conf:/srv/gnuhealth/gnuhealth/tryton/server/config gnuhealth
/usr/bin/docker run -d --rm --name gnuhealth -h gnuhealth --link=postgres -p 127.0.0.1:9008:8008 -v /srv/gnuhealth/conf:/srv/gnuhealth/gnuhealth/tryton/server/config gnuhealth
}
stop() {

View File

@ -8,14 +8,14 @@ docker build -t kanboard ${SOURCE_DIR}
# Populate database
export KANBOARD_PWD=$(head -c 18 /dev/urandom | base64)
envsubst <${SOURCE_DIR}/createdb.sql | docker exec -i postgres psql
docker run --rm kanboard cat /srv/kanboard/app/Schema/Sql/postgres.sql | docker exec -i -e PGPASSWORD=${KANBOARD_PWD} postgres psql kanboard kanboard
docker run --rm -h kanboard kanboard cat /srv/kanboard/app/Schema/Sql/postgres.sql | docker exec -i -e PGPASSWORD=${KANBOARD_PWD} postgres psql kanboard kanboard
# Configure Kanboard
mkdir -p /srv/kanboard/conf /srv/kanboard/data
envsubst <${SOURCE_DIR}/srv/kanboard/conf/config.php >/srv/kanboard/conf/config.php
export KANBOARD_ADMIN_USER=admin
export KANBOARD_ADMIN_PWD=$(head -c 12 /dev/urandom | base64)
export KANBOARD_ADMIN_HASH=$(docker run --rm kanboard php -r "echo password_hash('${KANBOARD_ADMIN_PWD}', PASSWORD_BCRYPT);")
export KANBOARD_ADMIN_HASH=$(docker run --rm -h kanboard kanboard php -r "echo password_hash('${KANBOARD_ADMIN_PWD}', PASSWORD_BCRYPT);")
envsubst <${SOURCE_DIR}/adminpwd.sql | docker exec -i postgres psql kanboard
chown 8009:8009 /srv/kanboard/data

View File

@ -9,7 +9,7 @@ depend() {
}
start() {
/usr/bin/docker run -d --rm --name kanboard --link=postgres -p 127.0.0.1:9009:8009 -v /srv/kanboard/data:/srv/kanboard/app/data -v /srv/kanboard/conf/config.php:/srv/kanboard/config.php kanboard
/usr/bin/docker run -d --rm --name kanboard -h kanboard --link=postgres -p 127.0.0.1:9009:8009 -v /srv/kanboard/data:/srv/kanboard/app/data -v /srv/kanboard/conf/config.php:/srv/kanboard/config.php kanboard
}
stop() {

View File

@ -8,7 +8,7 @@ depend() {
}
start() {
/usr/bin/docker run -d --rm --name openmapkit -p 127.0.0.1:9007:8007 -v /srv/openmapkit/settings.js:/srv/openmapkit/settings.js -v /srv/openmapkit/data:/srv/openmapkit/data openmapkit
/usr/bin/docker run -d --rm --name openmapkit -h openmapkit -p 127.0.0.1:9007:8007 -v /srv/openmapkit/settings.js:/srv/openmapkit/settings.js -v /srv/openmapkit/data:/srv/openmapkit/data openmapkit
}
stop() {

View File

@ -7,7 +7,7 @@ docker build -t postfix ${SOURCE_DIR}
# Copy existing config files into persistent storage
mkdir -p /srv/postfix/conf /srv/postfix/data
chown -R 587:587 /srv/postfix/data
docker run --rm -v /srv/postfix/conf:/mnt/conf postfix cp -rp /etc/postfix/. /mnt/conf
docker run --rm -h postfix -v /srv/postfix/conf:/mnt/conf postfix cp -rp /etc/postfix/. /mnt/conf
# Configure postfix
cp ${SOURCE_DIR}/srv/postfix/conf/main.cf /srv/postfix/conf/main.cf

View File

@ -8,7 +8,7 @@ depend() {
}
start() {
/usr/bin/docker run -d --rm --name postfix -v /srv/postfix/conf:/etc/postfix -v /srv/postfix/data:/var/spool/postfix postfix
/usr/bin/docker run -d --rm --name postfix -h postfix -v /srv/postfix/conf:/etc/postfix -v /srv/postfix/data:/var/spool/postfix postfix
}
stop() {

View File

@ -9,7 +9,7 @@ docker build -t postgres ${SOURCE_DIR}
mkdir /srv/postgres
chown -R 5432:5432 /srv/postgres
chmod 700 /srv/postgres
docker run --rm --name postgres -v /srv/postgres:/var/lib/postgresql postgres initdb -D /var/lib/postgresql
docker run --rm --name postgres -h postgres -v /srv/postgres:/var/lib/postgresql postgres initdb -D /var/lib/postgresql
# Configure Postgres
cp ${SOURCE_DIR}/srv/postgres/postgresql.conf /srv/postgres/postgresql.conf

View File

@ -8,7 +8,7 @@ depend() {
}
start() {
/usr/bin/docker run -d --rm --name postgres -v /srv/postgres:/var/lib/postgresql postgres
/usr/bin/docker run -d --rm --name postgres -h postgres -v /srv/postgres:/var/lib/postgresql postgres
}
stop() {

View File

@ -8,7 +8,7 @@ depend() {
}
start() {
/usr/bin/docker run -d --rm --name rabbitmq -v /srv/rabbitmq/data:/var/lib/rabbitmq/mnesia rabbitmq
/usr/bin/docker run -d --rm --name rabbitmq -h rabbitmq -v /srv/rabbitmq/data:/var/lib/rabbitmq/mnesia rabbitmq
}
stop() {

View File

@ -8,7 +8,7 @@ depend() {
}
start() {
/usr/bin/docker run -d --rm --name redis -v /srv/redis/redis.conf:/etc/redis.conf -v /srv/redis/data:/var/lib/redis redis
/usr/bin/docker run -d --rm --name redis -h redis -v /srv/redis/redis.conf:/etc/redis.conf -v /srv/redis/data:/var/lib/redis redis
}
stop() {

View File

@ -8,12 +8,12 @@ docker build -t seeddms ${SOURCE_DIR}
# Populate database
export SEEDDMS_PWD=$(head -c 18 /dev/urandom | base64)
envsubst <${SOURCE_DIR}/createdb.sql | docker exec -i postgres psql
docker run --rm seeddms cat /srv/seeddms/create_tables-postgres.sql | docker exec -i -e PGPASSWORD=${SEEDDMS_PWD} postgres psql seeddms seeddms
docker run --rm -h seeddms seeddms cat /srv/seeddms/create_tables-postgres.sql | docker exec -i -e PGPASSWORD=${SEEDDMS_PWD} postgres psql seeddms seeddms
# Copy existing files into persistent storage
mkdir -p /srv/seeddms/conf /srv/seeddms/data
docker run --rm -v /srv/seeddms/conf:/mnt/conf seeddms cp -rp /srv/seeddms/www/conf/. /mnt/conf
docker run --rm -v /srv/seeddms/data:/mnt/conf seeddms cp -rp /srv/seeddms/data/. /mnt/conf
docker run --rm -h seeddms -v /srv/seeddms/conf:/mnt/conf seeddms cp -rp /srv/seeddms/www/conf/. /mnt/conf
docker run --rm -h seeddms -v /srv/seeddms/data:/mnt/conf seeddms cp -rp /srv/seeddms/data/. /mnt/conf
chown -R 8010:8010 /srv/seeddms/data
# Configure SeedDMS

View File

@ -9,7 +9,7 @@ depend() {
}
start() {
/usr/bin/docker run -d --rm --name seeddms --link=postgres -p 127.0.0.1:9010:8010 -v /srv/seeddms/data:/srv/seeddms/data -v /srv/seeddms/conf:/srv/seeddms/www/conf seeddms
/usr/bin/docker run -d --rm --name seeddms -h seeddms --link=postgres -p 127.0.0.1:9010:8010 -v /srv/seeddms/data:/srv/seeddms/data -v /srv/seeddms/conf:/srv/seeddms/www/conf seeddms
}
stop() {

View File

@ -8,7 +8,7 @@ depend() {
}
start() {
/usr/bin/docker run -d --rm --name solr -v /srv/solr/data:/var/lib/solr solr
/usr/bin/docker run -d --rm --name solr -h solr -v /srv/solr/data:/var/lib/solr solr
}
stop() {