Allow to use env var to set hostname

Refs #39
This commit is contained in:
Stefan Verhoeven 2018-06-22 10:27:27 +02:00
parent f098d956c0
commit be4dad7bde
2 changed files with 8 additions and 1 deletions

View File

@ -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 <servers-external-ip-address> sverhoeven/cartodb docker run -d -p 80:80 -h <servers-external-ip-address> 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=<servers-external-ip-address> cartodb.example.com sverhoeven/cartodb
```
Persistent data Persistent data
--------------- ---------------

View File

@ -1,6 +1,8 @@
#!/bin/bash #!/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 postgresql start
service redis-server start service redis-server start