diff --git a/Dockerfile b/Dockerfile index 66c092e8..325a44ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,15 @@ FROM python:3.9-slim-buster -COPY . /app +# copy files over +COPY ./src /app/src +COPY ./requirements.txt /app/requirements.txt +# set working directory WORKDIR /app -RUN export PYTHONPATH=$PYTHONPATH:./src - +# install requirements +RUN pip install -U pip RUN pip install -r requirements.txt + +# make sure 'src' is in python path - this is so imports work +ENV PYTHONPATH=${PYTHONPATH}:/app/src diff --git a/docker-compose.yml b/docker-compose.yml index 76f138c9..27899dea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,7 +5,7 @@ services: # build: # context: . # dockerfile: Dockerfile - image: openclimatefix/nowcasting_api:0.1.5 + image: openclimatefix/nowcasting_api:0.1.7 container_name: nowcasting_api command: ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "80"] ports: diff --git a/src/main.py b/src/main.py index 6e8f628a..7c95de0b 100644 --- a/src/main.py +++ b/src/main.py @@ -15,7 +15,7 @@ logger = logging.getLogger(__name__) -version = "0.1.6" +version = "0.1.7" description = """ The Nowcasting API is still under development. It only returns zeros for now. """