File size: 1,057 Bytes
0f8b3a0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c71c578
 
0f8b3a0
 
 
e8ee71c
c71c578
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM python:3.12-slim-trixie

# System deps for the installer
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# Download the latest uv installer
ADD https://astral.sh/uv/install.sh /uv-installer.sh

# Run the installer then remove it
RUN sh /uv-installer.sh && rm /uv-installer.sh

# Ensure the installed binary is on the PATH
ENV PATH="/root/.local/bin:${PATH}"

# Set the work directory inside the container
WORKDIR /app

# Copy only dependency files first for better build cache usage
# Adjust these if your project uses different names
COPY pyproject.toml uv.lock* ./

# Install project dependencies into a project local virtual environment
RUN uv sync --frozen --no-dev

# Now copy the rest of the project
COPY . .

ENV VELAI_HOST="0.0.0.0"
ENV VELAI_PORT=7860
# Hugging Face Spaces mount persistent storage at /data when enabled.
ENV VELAI_STORAGE_PATH="/data"

EXPOSE 7860

# Default command to start your app
CMD ["uv", "run", "--no-sync", "--no-dev", "python", "main.py"]