MegaTronX commited on
Commit
f92590b
·
verified ·
1 Parent(s): 646fb97

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +59 -52
Dockerfile CHANGED
@@ -1,53 +1,60 @@
1
- # Base image with CUDA 12.2
2
- FROM nvidia/cuda:12.2.2-base-ubuntu22.04
3
-
4
- # Install pip if not already installed
5
- RUN apt-get update -y && apt-get install -y \
6
- python3-pip \
7
- python3-dev \
8
- git \
9
- build-essential # Install dependencies for building extensions
10
-
11
- # Define environment variables for UID and GID and local timezone
12
- ENV PUID=${PUID:-1000}
13
- ENV PGID=${PGID:-1000}
14
-
15
- # Create a group with the specified GID
16
- RUN groupadd -g "${PGID}" appuser
17
- # Create a user with the specified UID and GID
18
- RUN useradd -m -s /bin/sh -u "${PUID}" -g "${PGID}" appuser
19
-
20
- WORKDIR /app
21
-
22
- # Get sd-scripts from kohya-ss and install them
23
- RUN git clone -b sd3 https://github.com/kohya-ss/sd-scripts && \
24
- cd sd-scripts && \
25
- pip install --no-cache-dir -r ./requirements.txt
26
-
27
- # Install main application dependencies
28
- COPY ./requirements.txt ./requirements.txt
29
- RUN pip install --no-cache-dir -r ./requirements.txt
30
-
31
- # Install Torch, Torchvision, and Torchaudio for CUDA 12.2
32
- RUN pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu122/torch_stable.html
33
-
34
- RUN chown -R appuser:appuser /app
35
-
36
- # delete redundant requirements.txt and sd-scripts directory within the container
37
- RUN rm -r ./sd-scripts
38
- RUN rm ./requirements.txt
39
-
40
- #Run application as non-root
41
- USER appuser
42
-
43
- # Copy fluxgym application code
44
- COPY . ./fluxgym
45
-
46
- EXPOSE 7860
47
-
48
- ENV GRADIO_SERVER_NAME="0.0.0.0"
49
-
50
- WORKDIR /app/fluxgym
51
-
52
- # Run fluxgym Python application
 
 
 
 
 
 
 
53
  CMD ["python3", "./app.py"]
 
1
+ # Base image with CUDA 12.2
2
+ FROM nvidia/cuda:12.2.2-base-ubuntu22.04
3
+
4
+ # Install pip if not already installed
5
+ RUN apt-get update -y && apt-get install -y \
6
+ python3-pip \
7
+ python3-dev \
8
+ git \
9
+ build-essential # Install dependencies for building extensions
10
+
11
+ # Define environment variables for UID and GID and local timezone
12
+ ENV PUID=${PUID:-1000}
13
+ ENV PGID=${PGID:-1000}
14
+
15
+ # Create a group with the specified GID
16
+ RUN groupadd -g "${PGID}" appuser
17
+ # Create a user with the specified UID and GID
18
+ RUN useradd -m -s /bin/sh -u "${PUID}" -g "${PGID}" appuser
19
+
20
+ WORKDIR /app
21
+
22
+ RUN git clone https://github.com/cocktailpeanut/fluxgym && \
23
+ cd fluxgym && \
24
+ pip install --no-cache-dir -r ./requirements.txt && \
25
+ git clone -b sd3 https://github.com/kohya-ss/sd-scripts && \
26
+ cd sd-scripts && \
27
+ pip install --no-cache-dir -r ./requirements.txt
28
+
29
+ # Get sd-scripts from kohya-ss and install them
30
+ #RUN git clone -b sd3 https://github.com/kohya-ss/sd-scripts && \
31
+ # cd sd-scripts && \
32
+ # pip install --no-cache-dir -r ./requirements.txt
33
+
34
+ # Install main application dependencies
35
+ #COPY ./requirements.txt ./requirements.txt
36
+ #RUN pip install --no-cache-dir -r ./requirements.txt
37
+
38
+ # Install Torch, Torchvision, and Torchaudio for CUDA 12.2
39
+ RUN pip install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu122/torch_stable.html
40
+
41
+ RUN chown -R appuser:appuser /app
42
+
43
+ # delete redundant requirements.txt and sd-scripts directory within the container
44
+ RUN rm -r ./sd-scripts
45
+ RUN rm ./requirements.txt
46
+
47
+ #Run application as non-root
48
+ USER appuser
49
+
50
+ # Copy fluxgym application code
51
+ COPY . ./fluxgym
52
+
53
+ EXPOSE 7860
54
+
55
+ ENV GRADIO_SERVER_NAME="0.0.0.0"
56
+
57
+ WORKDIR /app/fluxgym
58
+
59
+ # Run fluxgym Python application
60
  CMD ["python3", "./app.py"]