Spaces:
Runtime error
Runtime error
GitHub Copilot
commited on
Commit
·
d60b133
1
Parent(s):
12593c9
Convert to Docker-based Space for full control over environment
Browse files- Dockerfile +40 -0
- README.md +2 -4
- requirements.txt +1 -2
Dockerfile
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.10 slim base
|
| 2 |
+
FROM python:3.10-slim
|
| 3 |
+
|
| 4 |
+
# Set working directory
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# Install system dependencies
|
| 8 |
+
RUN apt-get update && apt-get install -y \
|
| 9 |
+
git \
|
| 10 |
+
libgl1 \
|
| 11 |
+
libglib2.0-0 \
|
| 12 |
+
libsm6 \
|
| 13 |
+
libxext6 \
|
| 14 |
+
libxrender-dev \
|
| 15 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 16 |
+
|
| 17 |
+
# Create non-root user (HF Spaces requirement)
|
| 18 |
+
RUN useradd -m -u 1000 user
|
| 19 |
+
USER user
|
| 20 |
+
ENV HOME=/home/user \
|
| 21 |
+
PATH=/home/user/.local/bin:$PATH
|
| 22 |
+
|
| 23 |
+
# Set working directory for user
|
| 24 |
+
WORKDIR $HOME/app
|
| 25 |
+
|
| 26 |
+
# Copy requirements first for caching
|
| 27 |
+
COPY --chown=user:user requirements.txt .
|
| 28 |
+
|
| 29 |
+
# Install Python dependencies
|
| 30 |
+
RUN pip install --no-cache-dir --upgrade pip && \
|
| 31 |
+
pip install --no-cache-dir -r requirements.txt
|
| 32 |
+
|
| 33 |
+
# Copy application code
|
| 34 |
+
COPY --chown=user:user . .
|
| 35 |
+
|
| 36 |
+
# Expose Gradio port
|
| 37 |
+
EXPOSE 7860
|
| 38 |
+
|
| 39 |
+
# Run the application
|
| 40 |
+
CMD ["python", "app.py"]
|
README.md
CHANGED
|
@@ -3,11 +3,9 @@ title: LOGOS SPCW Matroska
|
|
| 3 |
emoji: 🌌
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
-
sdk:
|
| 7 |
-
|
| 8 |
-
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
-
layout: wide
|
| 11 |
short_description: "SPCW Protocol Visualizer & DSP Bridge"
|
| 12 |
---
|
| 13 |
|
|
|
|
| 3 |
emoji: 🌌
|
| 4 |
colorFrom: blue
|
| 5 |
colorTo: purple
|
| 6 |
+
sdk: docker
|
| 7 |
+
app_port: 7860
|
|
|
|
| 8 |
pinned: false
|
|
|
|
| 9 |
short_description: "SPCW Protocol Visualizer & DSP Bridge"
|
| 10 |
---
|
| 11 |
|
requirements.txt
CHANGED
|
@@ -2,7 +2,6 @@ numpy>=1.21.0
|
|
| 2 |
opencv-python-headless>=4.5.0
|
| 3 |
Pillow>=9.0.0
|
| 4 |
scikit-image>=0.19.0
|
| 5 |
-
gradio==4.
|
| 6 |
-
gradio_client==0.15.0
|
| 7 |
plotly
|
| 8 |
sympy
|
|
|
|
| 2 |
opencv-python-headless>=4.5.0
|
| 3 |
Pillow>=9.0.0
|
| 4 |
scikit-image>=0.19.0
|
| 5 |
+
gradio==4.20.0
|
|
|
|
| 6 |
plotly
|
| 7 |
sympy
|