customdiffusion360 commited on
Commit
cf89e54
·
1 Parent(s): 4a6cab7

try conda docker

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -42
Dockerfile CHANGED
@@ -1,62 +1,30 @@
1
- FROM nvidia/cuda:12.1.1-cudnn8-devel-ubuntu22.04
2
 
3
- ARG DEBIAN_FRONTEND=noninteractive
4
-
5
- ENV PYTHONUNBUFFERED=1
6
 
7
  RUN apt-get update && apt-get install --no-install-recommends -y \
8
  build-essential \
9
- wget \
10
- git \
11
  && apt-get clean && rm -rf /var/lib/apt/lists/*
12
 
13
- WORKDIR /code
14
-
15
  COPY ./requirements.txt /code/requirements.txt
16
 
17
- # Set up a new user named "user" with user ID 1000
18
- RUN useradd -m -u 1000 user
19
- # Switch to the "user" user
20
- USER user
21
- # Set home to the user's home directory
22
- ENV HOME=/home/user \
23
- PATH=/home/user/.local/bin:$PATH \
24
- PYTHONPATH=$HOME/app \
25
- PYTHONUNBUFFERED=1 \
26
- SYSTEM=spaces
27
-
28
- # Install miniconda
29
- ENV CONDA_DIR /home/user/conda
30
- RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh && \
31
- /bin/bash ~/miniconda.sh -b -p /home/user/conda
32
-
33
- # Put conda in path so we can use conda activate
34
- ENV PATH=$CONDA_DIR/bin:$PATH
35
-
36
- # Activate
37
- RUN conda init bash \
38
- && . ~/.bashrc
39
-
40
  # Install dependencies
41
  RUN conda create -n pose python=3.8
42
- RUN conda activate pose
 
 
43
 
44
  RUN pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118
45
 
46
- RUN pip install -r /code/requirements.txt
47
 
48
  RUN conda install -c conda-forge cudatoolkit-dev -y
49
  ENV CUDA_HOME=$CONDA_PREFIX/pkgs/cuda-toolkit/
50
  RUN pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"
51
 
52
 
53
- RUN wget https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors -P /code/pretrained_models
54
- RUN wget https://huggingface.co/stabilityai/sdxl-vae/resolve/main/sdxl_vae.safetensors -P /code/pretrained_models
55
-
56
- # Set the working directory to the user's home directory
57
- WORKDIR $HOME/app
58
-
59
- # Copy the current directory contents into the container at $HOME/app setting the owner to the user
60
- COPY --chown=user . $HOME/app
61
 
62
- CMD ["python", "app.py"]
 
1
+ FROM continuumio/miniconda3
2
 
3
+ WORKDIR /code
 
 
4
 
5
  RUN apt-get update && apt-get install --no-install-recommends -y \
6
  build-essential \
7
+ libxml2 \
 
8
  && apt-get clean && rm -rf /var/lib/apt/lists/*
9
 
 
 
10
  COPY ./requirements.txt /code/requirements.txt
11
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  # Install dependencies
13
  RUN conda create -n pose python=3.8
14
+
15
+ # Make RUN commands use the new environment:
16
+ SHELL ["conda", "run", "-n", "pose", "/bin/bash", "-c"]
17
 
18
  RUN pip install torch==2.1.0 torchvision==0.16.0 torchaudio==2.1.0 --index-url https://download.pytorch.org/whl/cu118
19
 
20
+ RUN pip install -r requirements.txt
21
 
22
  RUN conda install -c conda-forge cudatoolkit-dev -y
23
  ENV CUDA_HOME=$CONDA_PREFIX/pkgs/cuda-toolkit/
24
  RUN pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"
25
 
26
 
27
+ RUN wget https://huggingface.co/stabilityai/stable-diffusion-xl-base-1.0/resolve/main/sd_xl_base_1.0.safetensors -P pretrained_models
28
+ RUN wget https://huggingface.co/stabilityai/sdxl-vae/resolve/main/sdxl_vae.safetensors -P pretrained_models
 
 
 
 
 
 
29
 
30
+ ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "pose", "python", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0"]