-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (28 loc) · 1.1 KB
/
Copy pathDockerfile
File metadata and controls
37 lines (28 loc) · 1.1 KB
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
# Dockerfile for SL-GPS on Hugging Face Spaces
# Python 3.10 - all dependencies have pre-built wheels for this version
# NO source compilation allowed - using --only-binary for ALL packages
FROM python:3.10.15-slim
# Set working directory
WORKDIR /app
# Copy application code FIRST (so requirements.txt is available)
COPY . /app
# Only upgrade pip (minimal overhead)
RUN pip install --upgrade pip setuptools wheel
# Install from HF_SPACE_requirements.txt with STRICT wheel-only mode
# This prevents ANY source compilation, even if someone adds >= constraints
# Added -v flag for verbose output to help debug build issues
RUN pip install --no-cache-dir -v \
--only-binary=:all: \
-r HF_SPACE_requirements.txt || \
pip install --no-cache-dir -v \
--prefer-binary \
-r HF_SPACE_requirements.txt
# Install SL-GPS package
RUN pip install --no-cache-dir -v -e /app/src/slgps
# Expose Gradio default port
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python -c "import gradio; print('OK')" || exit 1
# Run the main app
CMD ["python", "app.py"]