Spaces:
Sleeping
Sleeping
Add Docker runtime for HF Spaces
Browse files- Dockerfile +27 -0
Dockerfile
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VectorVoid Grid Wars — Hugging Face Spaces (Docker)
|
| 2 |
+
FROM python:3.12-slim
|
| 3 |
+
|
| 4 |
+
WORKDIR /app
|
| 5 |
+
|
| 6 |
+
RUN apt-get update && apt-get install -y --no-install-recommends curl \
|
| 7 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
+
|
| 9 |
+
COPY requirements.txt .
|
| 10 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 11 |
+
|
| 12 |
+
COPY app.py .
|
| 13 |
+
COPY static ./static
|
| 14 |
+
|
| 15 |
+
RUN mkdir -p /data
|
| 16 |
+
|
| 17 |
+
ENV PORT=7860 \
|
| 18 |
+
DB_PATH=/data/neuraxon.db \
|
| 19 |
+
PYTHONUNBUFFERED=1 \
|
| 20 |
+
PYTHONDONTWRITEBYTECODE=1
|
| 21 |
+
|
| 22 |
+
EXPOSE 7860
|
| 23 |
+
|
| 24 |
+
HEALTHCHECK --interval=30s --timeout=5s --start-period=40s --retries=3 \
|
| 25 |
+
CMD curl -fsS "http://127.0.0.1:${PORT:-7860}/api/health" || exit 1
|
| 26 |
+
|
| 27 |
+
CMD ["sh", "-c", "mkdir -p /data && uvicorn app:app --host 0.0.0.0 --port ${PORT:-7860} --proxy-headers --forwarded-allow-ips='*'"]
|