This document covers how to install the multi-svc-cartodb
repository to a local development machine, build its component Docker images, and run the cluster of containers enabled by the docker-compose.yml
file in the repository root.
For information about deploying the containers to a cloud environment, please see DEPLOYMENT.md.
To use this repository, you will need:
-
Clone this repo to a local folder, and change directories into the root of the repo:
git clone https://github.com/ruralinnovation/multi-svc-cartodb.git cd multi-svc-cartodb
-
Look at the values in
build-configurations/DEFAULT.json
, and change those that seem appropriate, particularly the usernames, passwords, and email addresses. Be aware that changing other settings may impact your ability to build a running cluster, so only change values for things like version numbers, hostnames, etc. if you are confident of your choices. Note that if you change the passwords they will have to pass the Carto password test, which is that they are not included in Carto's list of common passwords. Additionally, the organization name must be all one word, lowercase letters only. -
You will also need to add an entry for
osscarto-multi.localhost
(or your chosen hostname if you changed the default) to your/etc/hosts
file, to make sure you get local DNS translation for your hostname and subdomain:echo "127.0.0.1 osscarto-multi.localhost" | sudo tee -a /etc/hosts
-
Generate the SSL certificates by running
make generate-ssl
and following the prompts. You should only need to do this once, though you can regenerate the certificates at any time. -
In order to make your local browser consider the
nginx
container's signed certificate legitimate, you'll need to add the root certificate of the signing CA you created to your local development machine's trusted cert store. On a Linux host that probably means adding it to/usr/local/share/ca-certificates/
, on a Mac it will mean adding it to your Keychain (for instructions see the Installing Your Root Certificate section of this article about local HTTPS). (TODO: Add Windows instructions.) The file you'll be targeting islocal-ssl/osscarto-multiCA.pem
(assuming the default hostname). -
Now you should be able to run the following (which can take quite a while, possibly up to an hour):
make install
Running that meta task is the equivalent of running:
make docker-build-cartobase
- builds the base image that thecartodb
,sqlapi
, andwindshaft
containers are built on top ofmake generate-build
- creates configuration and environment files based onbuild-configurations/DEFAULT.json
and places them inbuilds/DEFAULT
make use-build
- copies build-specific config files to the appropriate docker contexts, and copies SSL certs to contexts as wellmake packer-build-postgis
- builds the Docker image that thepostgis
container will be created frommake compose-build
- using the environment variables inbuilds/DEFAULT/docker-compose-DEFAULT.env
, runsdocker-compose build
against thedocker-compose.yml
file in the repo root, to build the Docker images for thenginx
,redis
,cartodb
,sqlapi
,windshaft
, andvarnish
containers to run from
Once that is complete, you should be able to start your cluster with make compose-up
, and (once it finishes initializing), view it in a browser at https://osscarto-multi.localhost
.