Public | Automated Build

Last pushed: 15 days ago
Short Description
CartoDB development server
Full Description

docker-cartodb


This docker container provides a fully working cartodb development solution
without the installation hassle.

Just run the commands and then connect to http://cartodb.localhost with your you browser.

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

It also creates an 'example' organization with owner login admin4example/pass1234.
Organization members can be created on http://cartodb.localhost/user/admin4example/organization

How to build the container:

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

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.

How to run the container:

docker run -d -p 80:80 -h cartodb.localhost sverhoeven/cartodb

The CartoDB instance has been configured with the hostname cartodb.localhost, this means the web browser and web server need to be able to resolve cartodb.localhost to an IP adress of the machine where the web server is running.
This can be done by adding cartodb.localhost alias to your hosts file. For example

sudo sh -c 'echo 127.0.1.1 cartodb.localhost >> /etc/hosts'

(For Windows it will be C:\Windows\System32\drivers\etc\hosts)

How to use a different hostname:

For example to use cartodb.example.com as a hostname start with:

docker run -d -p 80:80 -h cartodb.example.com sverhoeven/cartodb

The chosen hostname should also resolve to an IP adress of the machine where the web server is running.

Persistent data

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

The PostGreSQL data dir is filled during the building of this Docker image and must be copied to the local filesystem and then the container must be started with the local copy volume mounted.

docker create --name cartodb_pgdata sverhoeven/cartodb
# Change to directory to save the Postgresql data dir (cartodb_pgdata) of the CartoDB image
docker cp cartodb_pgdata:/var/lib/postgresql $PWD/cartodb_pgdata
docker rm -f cartodb_pgdata
# Inside container cartodb_pgdata is owned by postgres (uid=105) user,
# it should be owned by same user on the local filesystem
sudo chown -R 105.105 $PWD/cartodb_pgdata

After this the CartoDB container will have a database that stays filled after restarts.
The CartoDB container can be started with

docker run -d -p 80:80 -h cartodb.example.com -v $PWD/cartodb_pgdata:/var/lib/postgresql sverhoeven/cartodb

Geocoder

The external geocoders like heremaps or mapzen have dummy api keys and do not work.
No attempts haven 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.

Docker Pull Command
Owner
sverhoeven
Source Repository

Comments (17)
sverhoeven
4 months ago

The image was just updated with CartoDB code from 4-4-2017, Ubuntu 16.04, PostgresSQL 9.5 and analytics extension.

Could try to update the image?

mapsgeek
4 months ago

data type that has been uploaded was a zipped shapefile and geojson

mapsgeek
4 months ago

something wrong with this, data uploads successfully but they don't appear on the map or in the table, and when you make a request to the sql api the returned response contains a so strange geometry type which is like this but much more larger:
"the_geom":"0106000020E61000003E0100000103000000010000004A0000007F8478C1A8C863407008E1F46A111B4027CC7808A8C86340589580CA39111B40AD9001E6A7C86340E0E68A2727101B40715FAF08A8C86340D3FDB8E7EB0F1B40F05A

sandeepgadhwal
7 months ago

sir i installed your docker image on my windows system using docker client but it is not working i am getting 404 not found error

sindile
10 months ago

I have been able to install cartodb via docker.

I would like to use docker volumes to persist my data, how can I accomplish this.

chriswhong
10 months ago

Tried building this container today, and it fails during ogr2ogr installation:

The command '/bin/sh -c cd /opt && git clone https://github.com/OSGeo/gdal ogr2ogr2 && cd ogr2ogr2 && git remote add cartodb https://github.com/cartodb/gdal && git fetch cartodb && git checkout trunk && git pull origin trunk && git checkout upstream && git merge -s ours --ff-only origin/trunk && git checkout ogr2ogr2 && git merge -s ours upstream -m "Merged it" && cd ogr2ogr2 && ./configure --disable-shared && make -j 4 && cp apps/ogr2ogr /usr/bin/ogr2ogr2 && rm -rf /opt/ogr2ogr2 /root/.gitconfig' returned a non-zero code: 2
sverhoeven
a year ago

Never looked at the geocoder functionality before.

It seems it is performed by heremaps, mapzen and/or google. These require app identifiers and codes which I don't have. See https://github.com/sverhoeven/docker-cartodb/tree/geocoder for my attempt to get geocoding to work.

tailic
a year ago

Hi, thanks for the container. The "Geocoder SQL client + server" is installed but if I try to add Analysis > Georeference by whatever and submit it fails. The geocoder config inside app_config.yml is empty. Am I missing something?

sverhoeven
a year ago

@harlock, A new version of the image has been made. The Google login on the login page has been disabled. Could you try it?

harlock
a year ago

i succeeded to install this on Trusty, bit when accessing throught a browser, it gives me timeout, and the login page shows only sometimes, with nos CSS or mages loaded !!!

i think that i have missed something !

all help will be appreciated