-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
81 lines (66 loc) · 2.28 KB
/
Dockerfile
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# Fetch & build stage #########################################################
# ARGS
ARG BASEIMAGE_TAG='16-3.4'
ARG BUILDER_IMAGE_TAG='17-jdk-jammy'
# Base image
FROM eclipse-temurin:${BUILDER_IMAGE_TAG} AS builder
# Copy source code
WORKDIR /build
COPY ./3dcitydb /build
# Build
RUN chmod u+x ./gradlew && ./gradlew installDist
# Runtime stage ###############################################################
FROM postgres:16 AS runtime
# FROM postgis/postgis:16-3.2
# install: https://github.com/pgpointcloud/pointcloud/blob/master/docker/Dockerfile
ENV POSTGRES_VERSION 16
ENV POSTGIS_VERSION 3
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
postgis \
postgresql-${POSTGRES_VERSION}-postgis-${POSTGIS_VERSION} \
postgresql-${POSTGRES_VERSION}-postgis-${POSTGIS_VERSION}-scripts
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
git \
ca-certificates \
build-essential \
autoconf \
automake \
cmake \
zlib1g-dev \
postgresql-server-dev-all \
libxml2-dev \
&& rm -rf /var/lib/apt/lists/* \
&& git clone https://github.com/verma/laz-perf.git \
&& cd laz-perf \
&& cmake . \
&& make \
&& make install \
&& cd .. \
&& rm -r laz-perf \
&& git clone https://github.com/pgpointcloud/pointcloud \
&& cd pointcloud \
&& ./autogen.sh \
&& ./configure --with-lazperf=/usr/local --with-pgconfig=/usr/lib/postgresql/${POSTGRES_VERSION}/bin/pg_config CFLAGS="-Wall -Werror -O2 -g" \
&& make \
&& make install \
&& apt-get purge -y --auto-remove \
git \
ca-certificates \
build-essential \
autoconf \
automake \
cmake \
zlib1g-dev \
postgresql-server-dev-all \
libxml2-dev
RUN mkdir -p /docker-entrypoint-initdb.d
COPY ./pgpointcloud/docker/initdb-pgpointcloud.sh /docker-entrypoint-initdb.d/05_pgpointcloud.sh
# see: https://github.com/3dcitydb/3dcitydb/blob/master/postgresql/Dockerfile
ENV POSTGIS_SFCGAL true
# Copy SQL scripts
WORKDIR /3dcitydb
COPY --from=builder /build/build/install/3dcitydb/postgresql/sql-scripts .
COPY --from=builder /build/build/install/3dcitydb/postgresql/docker-scripts/3dcitydb-initdb.sh /docker-entrypoint-initdb.d/
COPY ./sensor-data-schema.sh /docker-entrypoint-initdb.d/15_sensordata-initschema.sh