/docker-cartodb-https

Dockerized CartoDB https

Primary LanguageJavaScriptBSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

docker-cartodb-https

This is an attempt to have a fully working https Cartodb Docker version of the https://hub.docker.com/r/sverhoeven/cartodb/ Docker solution as of May 2019 with the carto_db_production database and the Production environment.

The default login is prod/pass1234. You may want to change it when you run it for the outside.

It also creates an 'example' organization with owner login admin4example/pass1234. Organization members can be created on https://sub.domain.com/user/admin4example/organization

How to run the container:

sudo docker run -d -p 3000:3000 -p 8080:8080 -p 8181:8181 -h sub.domain.com --restart unless-stopped cartodb-https

You need to find and replace sub.domain.com with your domain in all configuration files.

Nginx needs to run on the host and redirect all the 443 calls to the proper local ports using proxies. SSL certificates then need to be configured on the host. Note that if assets are served locally, the host needs to be able to access the assets of the container (/cartodb/assets/public).

Persistent data

To persist the PostgreSQL data, the PostGreSQL data dir (/var/lib/postgresql) must be persisted outside the Cartodb Docker container.

One solution for this is to run the container, copy the /var/lib/postgresql/ data to the host in a folder called ~/cartodb_pgdata delete the container and then re-run it with

docker run -d -p 3000:3000 -p 8080:8080 -p 8181:8181 -h sub.domain.com -v $PWD/cartodb_pgdata:/var/lib/postgresql --restart unless-stopped cartodb-https

After this the CartoDB container will have a database that stays filled after restarts.

Geocoder

The external geocoders like heremaps, mapbox, mapzen or tomtom have dummy api keys and do not work. No attempts have been made or will be made in this Docker image to get the external geocoders to work.

The internal geocoder is configured, but contains no data inside the image.

To fill the internal geocoder run

docker exec -ti <carto docker container id> bash -c /cartodb/script/fill_geocoder.sh

This will run the scripts described at https://github.com/CartoDB/data-services/tree/master/geocoder It will use at least 5.7+7.8Gb of diskspace to download the dumps and import them.

How to build the image:

The image can be build with

git clone https://github.com/glaroc/docker-cartodb-https.git
docker build -t=cartodb-https docker-cartodb-https/

The build uses the master branches of the CartoDB GitHub repositories. A fresh build may fail when code requires newer dependencies then the Dockerfile provides or when code is not stable at the moment of building.

Driftwood Specific:

2 SSH Keys need to be available for copying from S3 into /.ssh upon build before start NGINX s3://carto-db-config/deomaps.crt s3://carto-db-config/deomaps.key

ENV Variables need to be set on host and passed during build and when running the container.

$FQDN # Fully qualified domain name (maps.driftwoodenergy.com) $CARTO_USER_SUBDOMAIN #INITIAL USER ACCOUNT $CARTO_USER_PW #INITIAL USER ACCOUNT $CARTO_USER_ADMIN_PW #INITIAL USER ACCOUNT $CARTO_USER_EMAIL #INITIAL USER ACCOUNT $CARTO_GEOCODER_PW #INITIAL GEOCODER ACCOUNT $CARTO_GEOCODER_ADMIN_PW #INITIAL GEOCODER ACCOUNT $CARTO_GEOCODER_EMAIL #INITIAL GEOCODER ACCOUNT $CARTO_ORG_NAME #INITIAL ORG $CARTO_ORG_USERNAME #INITIAL ORG $CARTO_ORG_EMAIL #INITIAL ORG $CARTO_ORG_PASSWORD #INITIAL ORG