File size: 678 Bytes
f66152c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Base image
FROM python:3.10-slim

# Prevent interactive prompts
ENV DEBIAN_FRONTEND=noninteractive

# Install system dependencies for Tkinter + virtual display
RUN apt-get update && apt-get install -y \
    python3-tk \
    xvfb \
    xauth \
    x11-apps \
    libx11-6 \
    libgtk-3-0 \
    && apt-get clean

# Set working directory
WORKDIR /app

# Copy project files
COPY . /app

# Install Python dependencies (if any)
RUN pip install --no-cache-dir -r requirements.txt || true

# Expose port (required for Hugging Face Spaces)
EXPOSE 7860

# Start app using virtual display (Xvfb)
CMD ["bash", "-c", "Xvfb :99 -screen 0 1024x768x16 & export DISPLAY=:99 && python app.py"]