Update Dockerfile
Browse files- Dockerfile +13 -2
Dockerfile
CHANGED
|
@@ -3,12 +3,14 @@ FROM python:3.10-slim
|
|
| 3 |
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
-
# Install system dependencies
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
git \
|
| 9 |
git-lfs \
|
| 10 |
gcc \
|
| 11 |
python3-dev \
|
|
|
|
|
|
|
| 12 |
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
# Initialize git-lfs
|
|
@@ -17,6 +19,15 @@ RUN git lfs install
|
|
| 17 |
# Clone the fastsdcpu repository
|
| 18 |
RUN git clone https://github.com/rupeshs/fastsdcpu.git .
|
| 19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
# Install Python dependencies
|
| 21 |
RUN python -m venv env && \
|
| 22 |
. env/bin/activate && \
|
|
@@ -30,7 +41,7 @@ RUN git clone https://huggingface.co/latent-consistency/lcm-lora-sdv1-5 /models/
|
|
| 30 |
# Configure the model path
|
| 31 |
RUN echo "/models/lcm-lora-sdv1-5" > configs/lcm-lora-models.txt
|
| 32 |
|
| 33 |
-
# Expose the API port
|
| 34 |
EXPOSE 8000
|
| 35 |
|
| 36 |
# Activate virtual environment and run the API server
|
|
|
|
| 3 |
# Set working directory
|
| 4 |
WORKDIR /app
|
| 5 |
|
| 6 |
+
# Install system dependencies, including libgl1 for OpenCV
|
| 7 |
RUN apt-get update && apt-get install -y \
|
| 8 |
git \
|
| 9 |
git-lfs \
|
| 10 |
gcc \
|
| 11 |
python3-dev \
|
| 12 |
+
libgl1 \
|
| 13 |
+
libglib2.0-0 \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
# Initialize git-lfs
|
|
|
|
| 19 |
# Clone the fastsdcpu repository
|
| 20 |
RUN git clone https://github.com/rupeshs/fastsdcpu.git .
|
| 21 |
|
| 22 |
+
# Create a writable cache directory for Hugging Face
|
| 23 |
+
RUN mkdir -p /app/.cache/huggingface && \
|
| 24 |
+
chmod -R 777 /app/.cache
|
| 25 |
+
|
| 26 |
+
# Set environment variables for Hugging Face and Transformers cache
|
| 27 |
+
ENV HF_HOME=/app/.cache/huggingface
|
| 28 |
+
ENV TRANSFORMERS_CACHE=/app/.cache/huggingface/hub
|
| 29 |
+
ENV XDG_CACHE_HOME=/app/.cache
|
| 30 |
+
|
| 31 |
# Install Python dependencies
|
| 32 |
RUN python -m venv env && \
|
| 33 |
. env/bin/activate && \
|
|
|
|
| 41 |
# Configure the model path
|
| 42 |
RUN echo "/models/lcm-lora-sdv1-5" > configs/lcm-lora-models.txt
|
| 43 |
|
| 44 |
+
# Expose the API port
|
| 45 |
EXPOSE 8000
|
| 46 |
|
| 47 |
# Activate virtual environment and run the API server
|