File size: 816 Bytes
3ea03df
 
 
 
 
cdf0064
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1010bf9
cdf0064
 
 
 
 
3ea03df
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.10-slim

# Suppress TensorFlow oneDNN warnings
ENV TF_ENABLE_ONEDNN_OPTS=0
ENV TF_CPP_MIN_LOG_LEVEL=2

# Set working directory
WORKDIR /app

# Install system dependencies
RUN apt-get update && apt-get install -y \
    libglib2.0-0 \
    libsm6 \
    libxext6 \
    libxrender-dev \
    libgomp1 \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements first for better Docker layer caching
COPY requirements-hf.txt .

# Install Python dependencies
RUN pip install --no-cache-dir -r requirements-hf.txt

# Copy application files
COPY app.py .
COPY model_info.json .
COPY best_autoencoder_model.h5 .
COPY src/ ./src/
COPY static/ ./static/
COPY templates/ ./templates/
COPY test_images/ ./test_images/

# Hugging Face Spaces runs on port 7860
EXPOSE 7860

# Run the Flask app
CMD ["python", "app.py"]