generated from openclimatefix/ocf-template
-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
15 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters