Adding a 2-phase docker build for testing.

RE:#1431
This commit is contained in:
James Douglass 2023-10-19 11:12:20 -07:00
parent c79bd8ee75
commit 576f4c4c2d
2 changed files with 20 additions and 0 deletions

1
docker/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
environment.yml

19
docker/Dockerfile Normal file
View File

@ -0,0 +1,19 @@
# syntax=docker/dockerfile:1
# Build the InVEST wheel in a separate container stage
FROM debian:12.2 as build
RUN apt update && apt install python3 python3-dev python3-pip python3-build build-essential
RUN python3 -m build && pwd
# Create the container for distribution that has runtime dependencies.
FROM mambaorg/micromamba:1.5.0-bookworm-slim
COPY --from build /dist/*.whl /tmp/
# The environment.yml file will be built during github actions.
COPY --chown=$MAMBA_USER:$MAMBA_USER environment.yml /tmp/environment.yml
RUN micromamba install -y -n base -c conda-forge -f /tmp/environment.yml && \
micromamba clean --all --yes && \
/opt/conda/bin/python -m pip install /tmp/*.whl
ENTRYPOINT ["/usr/local/bin/_entrypoint.sh"]