-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.spatial
56 lines (47 loc) · 2.23 KB
/
Dockerfile.spatial
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
# =============================================================================
# This Dockerfile implements a Docker container to run GeodataFlow (OSGeo).
#
# @Build:
# docker build -f ./Dockerfile.spatial -t geodataflow/cli:1.0.0 .
# docker image rmi geodataflow/cli:1.0.0
#
# @Env:
# PACKAGE_WITH_GEODATAFLOW_PIPELINE_CONTEXT="geodataflow.spatial"
#
# @Usage:
# docker run --rm --name gdf geodataflow/cli:1.0.0 --help
# docker run --rm --name gdf geodataflow/cli:1.0.0 --modules
#
# To run workflows in Linux:
# docker run --rm --name gdf -v "$PWD/geodataflow/spatial/tests/data:/tests/data" geodataflow/cli:1.0.0 --pipeline_file "/tests/data/test_eo_stac_catalog.json" --pipeline.TEST_DATA_PATH "/tests/data" --pipeline.TEST_OUTPUT_PATH "/tests/data"
# To run workflows in Windows:
# docker run --rm --name gdf -v "%cd%/geodataflow/spatial/tests/data:/tests/data" geodataflow/cli:1.0.0 --pipeline_file "/tests/data/test_eo_stac_catalog.json" --pipeline.TEST_DATA_PATH "/tests/data" --pipeline.TEST_OUTPUT_PATH "/tests/data"
#
# For interactive process:
# docker run --rm -it --entrypoint "bash" geodataflow/cli:1.0.0
#
# =============================================================================
FROM ghcr.io/osgeo/gdal:ubuntu-small-3.6.4
LABEL maintainer="Alvaro Huarte <ahuarte47@gmail.com>"
# Active PipelineContext.
ENV PACKAGE_WITH_GEODATAFLOW_PIPELINE_CONTEXT="geodataflow.spatial"
RUN echo "INFO: This Docker container provides the GeodataFlow CLI (OSGeo)!"
RUN set -x && \
apt-get update && \
apt-get install -y python3-pip wget --no-install-recommends && \
apt-get autoclean && \
apt-get autoremove && \
rm -rf /var/lib/{apt,dpkg,cache,log}
# Include GeodataFlow.
COPY ./geodataflow/core/geodataflow /app/geodataflow
COPY ./geodataflow/spatial/geodataflow /app/geodataflow
COPY ./geodataflow/spatial/requirements-dev.txt /app/requirements.txt
WORKDIR /app
# Clean existing "__pycache__" directories.
RUN find . -name "__pycache__" -type d -prune -exec rm -rf '{}' +
# Install python dependencies.
RUN pip3 install --no-cache-dir --requirement requirements.txt
RUN echo "INFO: Everything installed!"
RUN echo "INFO: You can run Geospatial workflows, type '--help'."
# Set entrypoint.
ENTRYPOINT ["python", "geodataflow/pipelineapp.py"]