Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -157,13 +157,13 @@ function services {
checkargn $# 2
if [ "$service_name" = "planet" ]; then
if [ -f /srv/planet/pwd/credentials.yml ]; then
if $dockercompose -f /srv/planet/planet.yml -f /srv/planet/volumes.yml -f /srv/planet/pwd/credentials.yml -p planet up -d ; then
if $dockercompose --project-directory /srv/planet -f /srv/planet/planet.yml -f /srv/planet/pwd/credentials.yml -p planet up -d ; then
echo "planet built and started"
else
log_and_exit1 "ERROR: cannot build planet"
fi
else
if $dockercompose -f /srv/planet/planet.yml -f /srv/planet/volumes.yml -p planet up -d ; then
if $dockercompose --project-directory /srv/planet -f /srv/planet/planet.yml -p planet up -d ; then
echo "planet built and started"
else
log_and_exit1 "ERROR: cannot build planet"
Expand Down
37 changes: 21 additions & 16 deletions services/install-planet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ function install {
# create service directory
mkdir -p /srv/planet

# create yml(s)
# create yml
{
echo "services:"
echo " couchdb:"
Expand All @@ -13,6 +13,21 @@ function install {
echo " image: treehouses/couchdb:2.3.1"
echo " ports:"
echo " - \"2200:5984\""
echo " volumes:"
echo " - \"/srv/planet/conf:/opt/couchdb/etc/local.d\""
echo " - \"/srv/planet/data:/opt/couchdb/data\""
echo " - \"/srv/planet/log:/opt/couchdb/var/log\""
echo " chatapi:"
echo " expose:"
echo " - 5000"
echo " image: treehouses/planet:chatapi-local"
echo " depends_on:"
echo " - couchdb"
echo " ports:"
echo " - \"5000:5000\""
echo " environment:"
echo " - COUCHDB_HOST=http://couchdb:5984"
echo " - SERVE_PORT=5000"
echo " db-init:"
echo " image: treehouses/planet:db-init-local"
echo " depends_on:"
Expand All @@ -25,31 +40,20 @@ function install {
echo " - \"80:80\""
echo " volumes:"
echo " - \"/var/run/docker.sock:/var/run/docker.sock\""
echo " - \"/srv/planet/pwd:/usr/share/nginx/html/credentials\""
echo " - \"/srv/planet/fs:/usr/share/nginx/html/fs\""
echo " - \"/srv/planet/.well-known:/usr/share/nginx/html/.well-known\""
echo " environment:"
echo " - MULTIPLE_IPS=true"
echo " - HOST_PROTOCOL=http"
echo " - DB_HOST=127.0.0.1"
echo " - DB_PORT=2200"
echo " - CENTER_ADDRESS=planet.earth.ole.org/db"
echo " - PARENT_PROTOCOL=https"
echo " depends_on:"
echo " - couchdb"
echo "version: \"2\""
} > /srv/planet/planet.yml

{
echo "services:"
echo " couchdb:"
echo " volumes:"
echo " - \"/srv/planet/conf:/opt/couchdb/etc/local.d\""
echo " - \"/srv/planet/data:/opt/couchdb/data\""
echo " - \"/srv/planet/log:/opt/couchdb/var/log\""
echo " planet:"
echo " volumes:"
echo " - \"/srv/planet/pwd:/usr/share/nginx/html/credentials\""
echo " - \"/srv/planet/fs:/usr/share/nginx/html/fs\""
echo "version: \"2\""
} > /srv/planet/volumes.yml

# add autorun
{
echo "planet_autorun=true"
Expand Down Expand Up @@ -78,6 +82,7 @@ function supported_arches {
function get_ports {
echo "80"
echo "2200"
echo "5000"
}

# add size (in MB)
Expand Down