#syntax=docker/dockerfile:1.3
FROM mambaorg/micromamba:0.15.2@sha256:e74f9ba39e549027dd2fb376afbf3f4f5f603747d684487ab2a26445f36ebadd

ENV FACET_HOME /home/facet
ENV PYTHONPATH "${FACET_HOME}"

USER ${USER}

# cache anything in /opt/conda/pkgs so we can build faster locally,
# but do not include them in the final build
RUN --mount=type=cache,id=conda-cmems,target=/opt/conda/pkgs,uid=1000,gid=1000 \
    # we only need the mamba environment.yml for install,
    # so we can mount it rather than copy it into the image
    --mount=type=bind,source=./pipelines/cmems/environment.yml,target=/tmp/environment.yml \
    micromamba install -y -n base -f /tmp/environment.yml

WORKDIR $FACET_HOME

COPY --chown=uid=1000,gid=1000 ./pipelines/cmems/cmems_common.py \
    ./pipelines/cmems/get_cmems.py \
    ./
#    ./pipelines/cmems/cmems.py \
    
#COPY ./tools/dagster/facet_shared/ ./facet_shared

#CMD ["dagster", "api", "grpc", "-h", "0.0.0.0", "-p", "4000", "-f", "cmems.py"]
