-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile-AWS
59 lines (47 loc) · 1.85 KB
/
Dockerfile-AWS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
FROM postgres:10
MAINTAINER James Saxon <[email protected]>
ENV POSTGIS_MAJOR 2.5
ENV POSTGIS_VERSION 2.5.0+dfsg-2.pgdg90+1
ENV PGROUTING_MAJOR 2.3
ENV PGROUTING_VERSION 2.3.0-1
RUN apt-get update && \
apt-get install -y zip git ca-certificates s3cmd && \
apt-get install -y --no-install-recommends \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \
postgis=$POSTGIS_VERSION \
postgresql-$PG_MAJOR-pgrouting \
vim wget \
git pkg-config build-essential
# osm2pgrouting Requirements
RUN apt-get install -y cmake expat libexpat1-dev \
libboost-dev libboost-program-options-dev libpqxx-dev
# compile osm2pgrouting
ENV OSM_2_PGROUTING_VERSION=2.3.3
RUN git clone https://github.com/pgRouting/osm2pgrouting.git
RUN cd osm2pgrouting && \
git fetch --all && git checkout v${OSM_2_PGROUTING_VERSION} && \
cmake -H. -Bbuild && \
cd build/ && make && make install
# compile osmium for pbf conversion
RUN apt-get install -y libbz2-dev zlib1g-dev
RUN mkdir work && cd work && \
git clone https://github.com/mapbox/protozero && \
git clone https://github.com/osmcode/libosmium && \
git clone https://github.com/osmcode/osmium-tool && \
cd osmium-tool && mkdir build && cd build && \
cmake .. && make && make install && cd /
COPY docker-build-and-query.sh \
start-postgres-db.sh \
stop-postgres-db.sh \
/usr/local/bin/
ADD scripts/ /scripts/
RUN mkdir -p /scripts/input/ /scripts/output/
RUN ln -s usr/local/bin/docker-build-and-query.sh /
RUN ln -s usr/local/bin/start-postgres-db.sh /
RUN ln -s usr/local/bin/stop-postgres-db.sh /
ENV AWS_DEFAULT_REGION=us-east-1 \
AWS_ACCESS_KEY_ID=XYZ \
AWS_SECRET_ACCESS_KEY=XYZ \
GEOID=17031
ENTRYPOINT ["docker-build-and-query.sh"]