Skip to content
This repository was archived by the owner on Jun 22, 2023. It is now read-only.

Commit a225ac6

Browse files
authored
Merge pull request #7 from Anagraph/feature/docker-configuration
Configure docker setup of pgh3 extension with postgis and pgrouting
2 parents ca5307f + 3a7b110 commit a225ac6

File tree

3 files changed

+59
-0
lines changed

3 files changed

+59
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55
*.ignored
66
sql/*--*.sql
77
/results
8+
.idea

Dockerfile

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
FROM pgrouting/pgrouting:13-3.1-3.1.3
2+
3+
ARG CMAKE_VERSION=3.22.2
4+
ARG H3_VERSION=3.7.2
5+
ARG CPUS=4
6+
7+
# dependencies
8+
RUN apt-get update
9+
RUN apt-get install -y git wget gcc build-essential libssl-dev clang-format cmake-curses-gui lcov doxygen libtool postgresql-server-dev-13
10+
11+
# install cmake
12+
RUN wget https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz
13+
RUN tar xzf cmake-${CMAKE_VERSION}.tar.gz
14+
WORKDIR cmake-${CMAKE_VERSION}
15+
RUN ./bootstrap
16+
RUN make
17+
RUN make install
18+
WORKDIR ..
19+
20+
# install h3 binding
21+
RUN mkdir h3
22+
WORKDIR h3
23+
RUN wget https://github.com/uber/h3/archive/refs/tags/v${H3_VERSION}.tar.gz
24+
RUN tar xf v${H3_VERSION}.tar.gz
25+
RUN mkdir build
26+
WORKDIR build
27+
RUN cmake -DCMAKE_C_FLAGS=-fPIC ../h3-${H3_VERSION}
28+
RUN make -j $CPUS
29+
RUN make install
30+
WORKDIR ../../
31+
32+
# install pgh3
33+
RUN git clone https://github.com/Anagraph/pgh3
34+
WORKDIR pgh3
35+
RUN git checkout ca5307f
36+
RUN make -j ${CPUS}
37+
RUN make install
38+
WORKDIR ..

docker-compose.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
version: "3.2"
2+
services:
3+
db:
4+
image: postgresql-pgh3
5+
build:
6+
context: .
7+
restart: always
8+
environment:
9+
POSTGRES_DB: postgres
10+
POSTGRES_PASSWORD: mypassword
11+
command: postgres -c shared_buffers=2GB -c max_connections=20 -c effective_cache_size=6GB -c maintenance_work_mem=1GB -c checkpoint_completion_target=0.9 -c wal_buffers=16MB -c default_statistics_target=500 -c random_page_cost=1.1 -c effective_io_concurrency=200 -c work_mem=52428kB -c min_wal_size=4GB -c max_wal_size=16GB -c max_worker_processes=2 -c max_parallel_workers_per_gather=1
12+
ports:
13+
- target: 5432
14+
published: 8433
15+
protocol: tcp
16+
mode: host
17+
volumes:
18+
- pg_data:/var/lib/postgresql/data
19+
volumes:
20+
pgdata:

0 commit comments

Comments
 (0)