Commit
·
656d339
1
Parent(s):
2cfb5a4
update dockerfile
Browse files- Dockerfile +13 -36
Dockerfile
CHANGED
|
@@ -1,11 +1,11 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
|
| 4 |
RUN apt-get update && apt-get install --no-install-recommends -y \
|
| 5 |
build-essential \
|
| 6 |
-
python3.8 \
|
| 7 |
-
python3-pip \
|
| 8 |
-
python3-setuptools \
|
| 9 |
git \
|
| 10 |
wget \
|
| 11 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
@@ -14,27 +14,8 @@ RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y
|
|
| 14 |
|
| 15 |
WORKDIR /code
|
| 16 |
|
| 17 |
-
# add conda
|
| 18 |
-
RUN wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -P /code/
|
| 19 |
-
RUN chmod 777 /code/Miniconda3-latest-Linux-x86_64.sh
|
| 20 |
-
RUN /code/Miniconda3-latest-Linux-x86_64.sh -b -p /code/miniconda
|
| 21 |
-
ENV PATH="/code/miniconda/bin:${PATH}"
|
| 22 |
-
|
| 23 |
-
RUN groupadd miniconda
|
| 24 |
-
RUN chgrp -R miniconda /code/miniconda/
|
| 25 |
-
RUN chmod 770 -R /code/miniconda/
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
# Set up a new user named "user" with user ID 1000
|
| 29 |
-
RUN useradd -m -u 1000 user
|
| 30 |
-
RUN adduser user miniconda
|
| 31 |
-
|
| 32 |
-
# Switch to the "user" user
|
| 33 |
-
USER user
|
| 34 |
# Set home to the user's home directory
|
| 35 |
ENV HOME=/home/user \
|
| 36 |
-
PATH=/home/user/.local/bin:$PATH \
|
| 37 |
-
PYTHONPATH=$HOME/app \
|
| 38 |
PYTHONUNBUFFERED=1 \
|
| 39 |
GRADIO_ALLOW_FLAGGING=never \
|
| 40 |
GRADIO_NUM_PORTS=1 \
|
|
@@ -42,17 +23,12 @@ ENV HOME=/home/user \
|
|
| 42 |
GRADIO_THEME=huggingface \
|
| 43 |
SYSTEM=spaces
|
| 44 |
|
| 45 |
-
RUN conda install python=3.8
|
| 46 |
-
|
| 47 |
-
RUN pip3 install setuptools-rust
|
| 48 |
|
| 49 |
-
RUN
|
| 50 |
-
|
| 51 |
-
RUN
|
| 52 |
-
|
| 53 |
-
RUN pip3 install openmim
|
| 54 |
-
|
| 55 |
-
RUN conda install -c conda-forge gradio -y
|
| 56 |
|
| 57 |
WORKDIR /home/user
|
| 58 |
|
|
@@ -62,15 +38,16 @@ RUN --mount=type=secret,id=git_token,mode=0444,required=true \
|
|
| 62 |
|
| 63 |
WORKDIR hls-foundation-os
|
| 64 |
|
| 65 |
-
RUN
|
|
|
|
|
|
|
| 66 |
|
| 67 |
RUN mim install mmcv-full==1.6.2 -f https://download.openmmlab.com/mmcv/dist/11.5/1.11.0/index.html
|
| 68 |
|
| 69 |
-
RUN pip3 install rasterio scikit-image
|
| 70 |
# Set the working directory to the user's home directory
|
| 71 |
WORKDIR $HOME/app
|
| 72 |
|
| 73 |
-
ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/miniconda/lib"
|
| 74 |
|
| 75 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 76 |
COPY --chown=user . $HOME/app
|
|
|
|
| 1 |
+
FROM python:3.8
|
| 2 |
|
| 3 |
|
| 4 |
RUN apt-get update && apt-get install --no-install-recommends -y \
|
| 5 |
build-essential \
|
| 6 |
+
# python3.8 \
|
| 7 |
+
# python3-pip \
|
| 8 |
+
# python3-setuptools \
|
| 9 |
git \
|
| 10 |
wget \
|
| 11 |
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
|
|
|
| 14 |
|
| 15 |
WORKDIR /code
|
| 16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
# Set home to the user's home directory
|
| 18 |
ENV HOME=/home/user \
|
|
|
|
|
|
|
| 19 |
PYTHONUNBUFFERED=1 \
|
| 20 |
GRADIO_ALLOW_FLAGGING=never \
|
| 21 |
GRADIO_NUM_PORTS=1 \
|
|
|
|
| 23 |
GRADIO_THEME=huggingface \
|
| 24 |
SYSTEM=spaces
|
| 25 |
|
| 26 |
+
# RUN conda install python=3.8
|
|
|
|
|
|
|
| 27 |
|
| 28 |
+
RUN pip install setuptools-rust
|
| 29 |
+
RUN pip install torch==1.11.0+cu115 torchvision==0.12.0+cu115 --extra-index-url https://download.pytorch.org/whl/cu115
|
| 30 |
+
RUN pip install gradio scikit-image pillow openmim
|
| 31 |
+
RUN pip install --upgrade setuptools
|
|
|
|
|
|
|
|
|
|
| 32 |
|
| 33 |
WORKDIR /home/user
|
| 34 |
|
|
|
|
| 38 |
|
| 39 |
WORKDIR hls-foundation-os
|
| 40 |
|
| 41 |
+
RUN git checkout 9968269915db8402bf4a6d0549df9df57d489e5a
|
| 42 |
+
|
| 43 |
+
RUN pip install -e .
|
| 44 |
|
| 45 |
RUN mim install mmcv-full==1.6.2 -f https://download.openmmlab.com/mmcv/dist/11.5/1.11.0/index.html
|
| 46 |
|
|
|
|
| 47 |
# Set the working directory to the user's home directory
|
| 48 |
WORKDIR $HOME/app
|
| 49 |
|
| 50 |
+
# ENV LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/code/miniconda/lib"
|
| 51 |
|
| 52 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 53 |
COPY --chown=user . $HOME/app
|