From 9869c53d18f7db1e1dd1e40cde36612cd1ea3f84 Mon Sep 17 00:00:00 2001 From: jfederico Date: Thu, 13 Feb 2020 13:49:31 -0500 Subject: Simplified use of HOST_NAME --- README.md | 3 +-- docker-compose.yml | 11 ++++++++--- dotenv | 4 +--- init-letsencrypt.sh | 4 +++- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index c9de675..ab5feba 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,7 @@ using docker-compose. - [scalelite](https://cloud.docker.com/u/blindsidenetwks/repository/docker/blindsidenetwks/scalelite) -- Make sure you have your own DNS and a public domain name or a delegated one under blindside-dev.com - (e.g. .blindside-dev.com) +- Make sure you have your own DNS and a public domain name or a delegated one (e.g. .blindside-dev.com). ## Preliminary steps diff --git a/docker-compose.yml b/docker-compose.yml index d3f0570..243fcbf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,11 +20,12 @@ services: - "80:80" - "443:443" environment: - - NGINX_HOSTNAME=${HOST_NAME:-sl}.${DOMAIN_SUB:-lab}.${DOMAIN_ROOT:-bigbluebutton.org} + - NGINX_HOSTNAME=${HOST_NAME:-sl.xlab.blindside-dev.com} depends_on: - scalelite.api command: /bin/bash -c "envsubst '$$NGINX_HOSTNAME' < /etc/nginx/sites-available/sites.template > /etc/nginx/sites-enabled/sites.conf && while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g 'daemon off;'" + certbot: image: certbot/certbot volumes: @@ -32,6 +33,7 @@ services: - ./data/certbot/www:/var/www/certbot entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'" + redis: image: redis restart: "no" @@ -40,6 +42,7 @@ services: volumes: - ./data/redis/:/data + postgres: image: postgres:9.5 restart: "no" @@ -53,6 +56,7 @@ services: - PGUSER=postgres - PGPASSWORD=password + scalelite.api: entrypoint: [bin/start] image: blindsidenetwks/scalelite:master @@ -76,7 +80,8 @@ services: - DB_NAME=scalelite_production - DB_USERNAME=postgres - DB_PASSWORD=password - - URL_HOST=${HOST_NAME:-sl}.${DOMAIN_SUB:-lab}.${DOMAIN_ROOT:-bigbluebutton.org} + - URL_HOST=${HOST_NAME:-sl.xlab.blindside-dev.com} + scalelite.poller: entrypoint: [bin/start-poller] @@ -92,5 +97,5 @@ services: env_file: ./scalelite/.env environment: - REDIS_URL=redis://redis:6379 - - URL_HOST=${HOST_NAME:-sl}.${DOMAIN_SUB:-lab}.${DOMAIN_ROOT:-bigbluebutton.org} + - URL_HOST=${HOST_NAME:-sl.xlab.blindside-dev.com} - INTERVAL=60 diff --git a/dotenv b/dotenv index 6c87fed..2c1317e 100644 --- a/dotenv +++ b/dotenv @@ -1,3 +1 @@ -DOMAIN_ROOT=bigbluebutton.org -DOMAIN_SUB=lab -HOST_NAME=sl +HOST_NAME=sl.xlab.blindside-dev.com diff --git a/init-letsencrypt.sh b/init-letsencrypt.sh index 13eaa75..1a4d3e3 100755 --- a/init-letsencrypt.sh +++ b/init-letsencrypt.sh @@ -5,7 +5,9 @@ if ! [ -x "$(command -v docker-compose)" ]; then exit 1 fi -domains=(example.org www.example.org) +HOST_NAME=$(grep HOST_NAME .env | cut -d '=' -f2) + +domains=($HOST_NAME) rsa_key_size=4096 data_path="./data/certbot" email="" # Adding a valid address is strongly recommended -- cgit v1.2.3