forked from soundscapeforeveryone/soundscape
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.ingest
32 lines (21 loc) · 1.62 KB
/
Dockerfile.ingest
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
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 as installer
RUN tdnf -y update \
&& tdnf install -y dnf \
&& mkdir /staging \
&& dnf install -y --release=2.0 --installroot /staging prebuilt-ca-certificates wget python3 python3-pip python3-setuptools
FROM mcr.microsoft.com/cbl-mariner/base/core:2.0 as imposm
ENV IMPOSM_BINARY_RELEASE=0.11.1
RUN tdnf -y update \
&& tdnf install -y ca-certificates-microsoft wget tar gzip \
&& mkdir -p /ingest/imposm3 \
&& wget -q -O - https://github.com/omniscale/imposm3/releases/download/v$IMPOSM_BINARY_RELEASE/imposm-$IMPOSM_BINARY_RELEASE-linux-x86-64.tar.gz | tar -xz --strip-components=1 -C /ingest/imposm3
FROM mcr.microsoft.com/cbl-mariner/distroless/base:2.0 as final
ENV PYTHONUNBUFFERED=true INGEST=/ingest TILES=/tiles MAPPING=/mapping UPDATE_FREQUENCY=minute
COPY --from=imposm /ingest/ $INGEST/
COPY --from=installer /staging/ /
COPY requirements.txt requirements_kubernetes.txt ingest.py kubescape.py tileperf.py queryperf.py extracts.json postgis-vt-util.sql tilefunc.sql $INGEST/
RUN /usr/bin/pip3 install -r $INGEST/requirements.txt -r $INGEST/requirements_kubernetes.txt
CMD rm -f $TILES/*.pbf && rm -rf $TILES/imposm_cache $TILES/imposm_expired $TILES/imposm_diff && \
python3 $INGEST/ingest.py --imposm $INGEST/imposm3/imposm --mapping $MAPPING/mapping.yml --where $GEN_REGIONS --extracts $INGEST/extracts.json --cachedir $TILES/imposm_cache --diffdir $TILES/imposm_diff --pbfdir $TILES --expiredir $TILES/imposm_expired --verbose --updatemodel importloop --delay $LOOP_TIME --telemetry $INGEST_FLAGS