From b393e9c12ab48ec9a932741dea9e549d2f810495 Mon Sep 17 00:00:00 2001 From: Tom Hodson Date: Wed, 11 Dec 2024 13:39:12 +0000 Subject: [PATCH] fix dockerfile --- dockerfile | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/dockerfile b/dockerfile index 4007a20..107aa6d 100644 --- a/dockerfile +++ b/dockerfile @@ -1,15 +1,34 @@ FROM python:3.12-slim AS stac_server + +RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ + openssh-client \ + git \ + && apt-get clean + +RUN mkdir -p -m 0600 ~/.ssh && \ + ssh-keyscan -H github.com >> ~/.ssh/known_hosts + +# Get Rust +RUN curl https://sh.rustup.rs -sSf | bash -s -- -y +ENV PATH="/root/.cargo/bin:${PATH}" + WORKDIR /code COPY stac_server/requirements.txt /code/requirements.txt RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt +# Todo: don't embed this here, mount them at runtime +COPY config/destinE/schema /config/schema +COPY config/destinE/language.yaml /config/language.yaml -COPY config/destinE_schema /config/schema -COPY config/language.yaml /config/language.yaml +COPY ./tree_compresser /code/tree_compresser - -COPY ./TreeTraverser /code/TreeTraverser -RUN pip install --no-cache-dir -e /code/TreeTraverser +# Clone the rsfdb and rsfindlibs repos manually because they're private +RUN --mount=type=ssh git clone ssh://git@github.com/ecmwf/rsfdb.git +RUN --mount=type=ssh git clone ssh://git@github.com/ecmwf/rsfindlibs.git +RUN pip install --no-cache-dir -e /code/tree_compresser COPY ./stac_server /code/stac_server + WORKDIR /code/stac_server CMD ["fastapi", "dev", "main.py", "--proxy-headers", "--port", "8080", "--host", "0.0.0.0"] \ No newline at end of file