File size: 1,618 Bytes
e64ee47
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# Use an official Python runtime as a parent image
# We use the full image to ensure all AI/OpenCV dependencies are compatible
FROM python:3.10

# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1

# Install system dependencies for OpenCV, AI models, and Font Rendering
RUN apt-get update && apt-get install -y \
    wget \
    fontconfig \
    libfontconfig1 \
    libgl1 \
    libglib2.0-0 \
    libsm6 \
    libxext6 \
    libxrender1 \
    libasound2 \
    fonts-dejavu-core \
    fonts-liberation \
    fonts-noto-core \
    fonts-noto-extra \
    fonts-noto-color-emoji \
    libraqm0 \
    libfreetype6 \
    libfribidi0 \
    libharfbuzz0b \
    libprotobuf-dev \
    protobuf-compiler \
    && rm -rf /var/lib/apt/lists/*

# Set the working directory in the container
WORKDIR /app

# Download high-quality fonts to bypass Git LFS issues
RUN mkdir -p assets && \
    wget -O assets/tahomabd.ttf "https://raw.githubusercontent.com/Esmaill1/color-stealer/main/tahomabd.ttf" && \
    wget -O assets/TYBAH.TTF "https://raw.githubusercontent.com/Esmaill1/color-stealer/main/TYBAH.TTF" && \
    wget -O assets/arialbd.ttf "https://raw.githubusercontent.com/Esmaill1/color-stealer/main/arialbd.ttf"

# Copy the requirements file into the container
COPY requirements.txt .

# Install any needed packages specified in requirements.txt
# We use --no-cache-dir to keep the image small
RUN pip install --no-cache-dir -r requirements.txt

# Copy the rest of the application code
COPY . .

# Expose port 7860 for Hugging Face Spaces
EXPOSE 7860

# Run the server
CMD ["python", "web/server.py"]