Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions DOCKER.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ You can now use Docker to load this extract into your local Docker-based OSM ins
docker-compose run --rm web osmosis \
-verbose \
--read-pbf district-of-columbia-latest.osm.pbf \
--log-progress \
--write-apidb \
host="db" \
database="openstreetmap" \
Expand Down
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive

# Install system packages
# Install system packages then clean up to minimize image size
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
build-essential \
Expand Down Expand Up @@ -30,7 +30,7 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install current Osmosis
# Install compatible Osmosis to help users import sample data in a new instance
RUN curl -OL https://github.com/openstreetmap/osmosis/releases/download/0.47.2/osmosis-0.47.2.tgz \
&& tar -C /usr/local -xzf osmosis-0.47.2.tgz

Expand All @@ -45,6 +45,7 @@ ADD Gemfile Gemfile.lock /app/
RUN gem install bundler \
&& bundle install

# Install NodeJS packages
# Install NodeJS packages using yarnpkg
# `bundle exec rake yarn:install` will not work
ADD package.json yarn.lock /app/
RUN yarnpkg install
2 changes: 1 addition & 1 deletion config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup" if ENV.fetch("ENABLE_BOOTSNAP", "true") == "true" # Speed up boot time by caching expensive operations.
require "bootsnap/setup" # Speed up boot time by caching expensive operations.
3 changes: 0 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@ services:
- web-images:/home/osm/images
ports:
- "3000:3000"
environment:
# https://github.com/Shopify/bootsnap/issues/262
ENABLE_BOOTSNAP: 'false'
command: bundle exec rails s -p 3000 -b '0.0.0.0'
depends_on:
- db
Expand Down
2 changes: 1 addition & 1 deletion docker/postgres/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ FROM postgres:11
ADD docker/postgres/openstreetmap-postgres-init.sh /docker-entrypoint-initdb.d/

# Custom database functions are in a SQL file.
ADD db/functions/functions.sql /usr/local/sbin/osm-db-functions.sql
ADD db/functions/functions.sql /usr/local/share/osm-db-functions.sql
3 changes: 2 additions & 1 deletion docker/postgres/openstreetmap-postgres-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
set -ex

# Create 'openstreetmap' user
# Password and superuser privilege are needed to successfully run test suite
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" <<-EOSQL
CREATE USER openstreetmap SUPERUSER PASSWORD 'openstreetmap';
GRANT ALL PRIVILEGES ON DATABASE openstreetmap TO openstreetmap;
Expand All @@ -11,4 +12,4 @@ EOSQL
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -c "CREATE EXTENSION btree_gist" openstreetmap

# Define custom functions
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -f "/usr/local/sbin/osm-db-functions.sql" openstreetmap
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -f "/usr/local/share/osm-db-functions.sql" openstreetmap