|
FROM continuumio/miniconda3 |
|
|
|
RUN apt-get update && apt-get install -y \ |
|
apt-transport-https \ |
|
ca-certificates \ |
|
gnupg2 \ |
|
--no-install-recommends |
|
|
|
|
|
RUN echo "deb http://deb.debian.org/debian unstable main" > /etc/apt/sources.list.d/unstable.list && \ |
|
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 04EE7237B7D453EC && \ |
|
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 648ACFD622F3D138 |
|
|
|
RUN apt-get install -y build-essential ffmpeg libsm6 libxext6 |
|
RUN apt-get update |
|
RUN apt-get install -t unstable -y gdal-bin libgdal-dev |
|
RUN apt-get install curl |
|
|
|
RUN conda install -y python=3.10 |
|
|
|
RUN mkdir -p /data |
|
|
|
RUN chmod 777 /data |
|
|
|
RUN useradd -m -u 1000 user |
|
|
|
USER user |
|
|
|
ENV HOME=/home/user \ |
|
PATH=/home/user/.local/bin:$PATH |
|
|
|
WORKDIR $HOME/app |
|
|
|
RUN python -m pip install torchvision torch |
|
RUN python -m pip install git+https://github.com/facebookresearch/detectron2.git |
|
RUN python -m pip install torchvision torch rasterio |
|
RUN python -m pip install git+https://github.com/PatBall1/detectree2.git |
|
RUN python -m pip install opencv-python |
|
RUN python -m pip install requests |
|
|
|
RUN python -m pip install gradio |
|
RUN python -m pip install plotly |
|
|
|
COPY --chown=user . $HOME/app |
|
|
|
RUN mkdir -m 700 -p $HOME/app/cache |
|
|
|
EXPOSE 7860 |
|
|
|
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "curl", "localhost:7860" ] |
|
|
|
CMD ["python", "-u", "main.py"] |
|
|