From 6a1aaeb8b5c87e588b4ef5a0d9c6949a995c257a Mon Sep 17 00:00:00 2001 From: peterdudfield Date: Mon, 26 Feb 2024 19:39:03 +0000 Subject: [PATCH] change back to dockerfile --- .github/workflows/docker-build.yml | 2 +- Dockerfile | 31 ++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index 6fd5dbb..b352111 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -14,4 +14,4 @@ jobs: uses: docker/setup-buildx-action@v1 - name: Build - run: docker build . -f ContainerFile --no-cache + run: docker build . diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8fcc13e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,31 @@ +FROM python:3.11-slim + +RUN apt-get update +RUN apt-get install -y git + +ENV PYTHONFAULTHANDLER=1 \ + PYTHONHASHSEED=random \ + PYTHONUNBUFFERED=1 + +WORKDIR /app + +RUN apt-get update +RUN apt-get install -y gdal-bin libgdal-dev g++ + +ENV PIP_DEFAULT_TIMEOUT=100 \ + PIP_DISABLE_PIP_VERSION_CHECK=1 \ + PIP_NO_CACHE_DIR=1 \ + POETRY_VERSION=1.7.1 + +RUN pip install "poetry==$POETRY_VERSION" + +COPY pyproject.toml poetry.lock README.md . +RUN poetry install --no-dev --no-root + +COPY india_forecast_app ./india_forecast_app +RUN poetry build +RUN poetry install + +COPY nwp.zarr ./nwp.zarr + +ENTRYPOINT ["poetry", "run" , "python3", "india_forecast_app/app.py", "--write-to-db"] \ No newline at end of file