diff --git a/Dockerfile b/Dockerfile index aef81e0..3f39349 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,42 +1,36 @@ -FROM python:3.10-slim +FROM continuumio/miniconda3 ARG TESTING=0 -# make sure it doesnt fail if the docker file doesnt know the git commit -ARG GIT_PYTHON_REFRESH=quiet +SHELL ["/bin/bash", "-l", "-c"] RUN apt-get update RUN apt-get install git -y RUN apt-get install g++ gcc libgeos++-dev libproj-dev proj-data proj-bin -y -# copy files +# Copy files COPY setup.py app/setup.py COPY README.md app/README.md COPY requirements.txt app/requirements.txt -RUN pip install git+https://github.com/SheffieldSolar/PV_Live-API#pvlive_api - - -# install requirements -RUN pip install torch --index-url https://download.pytorch.org/whl/cpu -RUN conda install -c conda-forge esmpy xarray numpy shapely cf_xarray sparse numba -RUN pip install -r app/requirements.txt - -# copy library files COPY pvnet_app/ app/pvnet_app/ COPY tests/ app/tests/ COPY scripts/ app/scripts/ COPY data/ app/data/ -# change to app folder +# Install requirements +RUN conda install python=3.10 +RUN conda install -c conda-forge xesmf esmpy -y +RUN echo "export ESMFMKFILE='/opt/conda/lib/esmf.mk'" >> ~/.bashrc +RUN pip install torch --index-url https://download.pytorch.org/whl/cpu +RUN pip install -r app/requirements.txt +RUN pip install git+https://github.com/SheffieldSolar/PV_Live-API#pvlive_api + +# Change to app folder WORKDIR /app -# install library +# Install library RUN pip install -e . -# download models so app can used cached -RUN python scripts/cache_default_models.py - - RUN if [ "$TESTING" = 1 ]; then pip install pytest pytest-cov coverage; fi -CMD ["python", "-u","pvnet_app/app.py"] +CMD ["python", "-u","pvnet_app/app.py"] \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index f0bec76..7cb998b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,3 @@ -xesmf torch[cpu]>=2.0 PVNet-summation>=0.0.8 pvnet>=2.3.0 @@ -8,7 +7,7 @@ fsspec[s3] xarray zarr numpy -pandas==2.0 +pandas sqlalchemy torchdata pytest