From be4dad7bde797ebca7243c47e9c0f82464739f00 Mon Sep 17 00:00:00 2001 From: Stefan Verhoeven Date: Fri, 22 Jun 2018 10:27:27 +0200 Subject: [PATCH] Allow to use env var to set hostname Refs #39 --- README.md | 5 +++++ startup.sh | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 589ab2b..c9bc3db 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,11 @@ If you don't have a domain/subdomain pointing to your server yet, you can use th docker run -d -p 80:80 -h sverhoeven/cartodb ``` +Instead of setting hostname with `-h` you can also use the `CARTO_HOSTNAME` environment variable with: +``` +docker run -d -p 80:80 -e CARTO_HOSTNAME= cartodb.example.com sverhoeven/cartodb +``` + Persistent data --------------- diff --git a/startup.sh b/startup.sh index ce10c75..177f6b9 100755 --- a/startup.sh +++ b/startup.sh @@ -1,6 +1,8 @@ #!/bin/bash -perl -pi -e 's/cartodb\.localhost/$ENV{"HOSTNAME"}/g' /etc/nginx/sites-enabled/default /cartodb/config/app_config.yml /Windshaft-cartodb/config/environments/development.js +CARTO_HOSTNAME = ${CARTO_HOSTNAME:=$HOSTNAME} + +perl -pi -e 's/cartodb\.localhost/$ENV{"CARTO_HOSTNAME"}/g' /etc/nginx/sites-enabled/default /cartodb/config/app_config.yml /Windshaft-cartodb/config/environments/development.js service postgresql start service redis-server start