Skip to content

Instantly share code, notes, and snippets.

@Firefishy
Created March 26, 2016 19:54
Show Gist options
  • Save Firefishy/c1b6eb0acf36ba68a6eb to your computer and use it in GitHub Desktop.
Save Firefishy/c1b6eb0acf36ba68a6eb to your computer and use it in GitHub Desktop.
Quickstart for OSM in Docker
#!/bin/bash
set -e
type docker >/dev/null 2>&1 || { echo >&2 "error: docker is required. See: https://docs.docker.com/engine/installation/linux/"; exit 1; }
type docker-compose >/dev/null 2>&1 || { echo >&2 "error: docker-compose is required. See: https://docs.docker.com/compose/install/"; exit 1; }
[ ! -d cgimap ] && git clone --branch add-docker --depth 1 https://github.com/Firefishy/cgimap.git;
[ ! -d openstreetmap-website ] && git clone --branch add-docker --depth 1 https://github.com/Firefishy/openstreetmap-website.git
(cd cgimap && docker build -t openstreetmap/cgimap .)
(cd openstreetmap-website && docker-compose run --rm app bundle exec rake db:migrate)
(cd openstreetmap-website && docker-compose up)
# remove environment; cd openstreetmap-website ; docker-compose down
# remove persistant volumes... docker volume rm openstreetmapwebsite_data-images openstreetmapwebsite_data-traces openstreetmapwebsite_data-db openstreetmapwebsite_data-attachments
@mmd-osm
Copy link

mmd-osm commented Mar 28, 2016

It's a bit irritating that cgimap stops with a fatal error, but that seems to be normal as the database is about to start up. Automatic service restart takes care of it, though...

Starting openstreetmapwebsite_db_1
Starting openstreetmapwebsite_app_1
Starting openstreetmapwebsite_cgimap_1
Attaching to openstreetmapwebsite_memcached_1, openstreetmapwebsite_db_1, openstreetmapwebsite_app_1, openstreetmapwebsite_cgimap_1
db_1        | LOG:  database system was interrupted; last known up at 2016-03-28 16:11:45 UTC
db_1        | FATAL:  the database system is starting up
cgimap_1    | Error: FATAL:  the database system is starting up
cgimap_1    | 
db_1        | LOG:  database system was not properly shut down; automatic recovery in progress
db_1        | LOG:  record with zero length at 0/26F57F0
db_1        | LOG:  redo is not required
db_1        | LOG:  database system is ready to accept connections
db_1        | LOG:  autovacuum launcher started
openstreetmapwebsite_cgimap_1 exited with code 0
app_1       | => Booting WEBrick

@mvexel
Copy link

mvexel commented Oct 12, 2021

Confirmed with @Firefishy that this is no longer current, see https://github.com/openstreetmap/openstreetmap-website/blob/master/DOCKER.md for an up-to-date method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment