Skip to content

Commit

Permalink
Trial micromamba/conda-forge based docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
omad committed Aug 13, 2024
1 parent 0d5ca2f commit 5cbc246
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
datacube_wms/wms_cfg_local.py
.pytest_cache
*/__pycache__

venv
.venv

.pixi
.git
22 changes: 22 additions & 0 deletions Dockerfile.micromamba
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM mambaorg/micromamba:1.5.8
COPY --chown=$MAMBA_USER:$MAMBA_USER env.micromamba.yaml /tmp/env.yaml
RUN --mount=type=cache,target=/opt/conda/pkgs micromamba install -y -n base -f /tmp/env.yaml && \
micromamba clean --all --yes

ARG MAMBA_DOCKERFILE_ACTIVATE=1 # (otherwise python will not be found)


COPY --chown=$MAMBA_USER:$MAMBA_USER . /tmp/code

ARG PSEUDO_VERSION # strongly recommended to update based on git describe

RUN SETUPTOOLS_SCM_PRETEND_VERSION_FOR_DATACUBE_OWS=${PSEUDO_VERSION} pip install /tmp/code #-e .[test]
#RUN pip install /code
#python -c 'import uuid; print(uuid.uuid4())' > /tmp/my_uuid

ENV GDAL_DISABLE_READDIR_ON_OPEN="EMPTY_DIR" \
CPL_VSIL_CURL_ALLOWED_EXTENSIONS=".tif, .tiff" \
GDAL_HTTP_MAX_RETRY="10" \
GDAL_HTTP_RETRY_DELAY="1"

CMD ["gunicorn", "-b", "0.0.0.0:8000", "--workers=3", "-k", "gthread", "--timeout", "121", "--pid", "/tmp/gunicorn.pid", "--log-level", "info", "--worker-tmp-dir", "/dev/shm", "--config", "python:datacube_ows.gunicorn_config", "datacube_ows.wsgi"]
27 changes: 27 additions & 0 deletions env.micromamba.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: base
channels:
- conda-forge
dependencies:
- python=3.12
- datacube
- flask
- gunicorn
- geoalchemy2
- pillow
- requests
- lxml
- deepdiff
- scipy
- flask-babel
- regex
- matplotlib
- python-slugify
- prometheus_flask_exporter
- timezonefinder
- iso8601
- ciso8601
- colour
- setuptools_scm
- bottleneck
- pip:
- pyows

0 comments on commit 5cbc246

Please sign in to comment.