Skip to content

Commit 44ec415

Browse files
committed
Add docker
1 parent 710d5e8 commit 44ec415

7 files changed

Lines changed: 76 additions & 0 deletions

File tree

Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM ruby:3.0-alpine
2+
3+
RUN apk add --no-cache --virtual \
4+
build-dependencies \
5+
build-base \
6+
git \
7+
ruby-dev \
8+
postgresql-dev
9+
10+
WORKDIR /srv/app
11+
12+
ADD Gemfile Gemfile.lock ./
13+
RUN bundle config --global silence_root_warning 1
14+
RUN bundle install
15+
16+
ADD . ./
17+
18+
EXPOSE 9000

data/.placeholder

Whitespace-only changes.

docker-compose.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
version: "3.3"
2+
3+
services:
4+
postgres:
5+
image: postgis/postgis:15-3.4
6+
shm_size: 1g
7+
environment:
8+
POSTGRES_HOST_AUTH_METHOD: trust
9+
volumes:
10+
- ./docker/postgres/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
11+
- pgdata:/var/lib/postgresql/data
12+
restart: unless-stopped
13+
14+
api:
15+
build:
16+
context: .
17+
environment:
18+
DATABASE_URL: postgresql://postgres@postgres:5432/postgres
19+
volumes:
20+
- ./config.ru:/srv/app/config.ru
21+
- ./backends:/srv/app/backends
22+
ports:
23+
- ${API_PORT:-9292}:9292
24+
depends_on:
25+
- postgres
26+
command: bundle exec rackup --host 0.0.0.0
27+
restart: unless-stopped
28+
29+
osmosis:
30+
profiles: [tools]
31+
build:
32+
context: docker/osmosis
33+
environment:
34+
DATABASE_URL: postgresql://postgres@postgres:5432/postgres
35+
volumes:
36+
- ./backends:/backends
37+
- ./data:/data
38+
depends_on:
39+
- postgres
40+
41+
volumes:
42+
pgdata:

docker/osmosis/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM debian:12
2+
3+
RUN apt update -y && apt install -y \
4+
osmosis \
5+
postgresql-client
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
DROP SCHEMA IF EXISTS tiger CASCADE;
2+
DROP EXTENSION IF EXISTS postgis_tiger_geocoder;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CREATE EXTENSION IF NOT EXISTS htsore;
2+
3+
-- Same as ->, for code compatibility with json
4+
CREATE OPERATOR ->> (
5+
LEFTARG = hstore,
6+
RIGHTARG = text,
7+
PROCEDURE = fetchval
8+
);
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CREATE EXTENSION IF NOT EXISTS postgis;

0 commit comments

Comments
 (0)