Spaces:
Running
Running
File size: 1,056 Bytes
08c19c7 | 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 | # ---------------------------------------------------------------------------
# Smart Contract Audit RL Environment
# Hugging Face Space — Docker runtime
# ---------------------------------------------------------------------------
FROM python:3.11-slim
WORKDIR /app
# System deps
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Python deps first (layer cache)
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy project
COPY . .
# Create empty __init__ files if missing (safety)
RUN touch env/__init__.py tasks/__init__.py tasks/task1/__init__.py \
tasks/task2/__init__.py tasks/task3/__init__.py \
data/__init__.py utils/__init__.py
# HF Spaces requires port 7860
EXPOSE 7860
# Healthcheck
HEALTHCHECK --interval=30s --timeout=10s --start-period=15s --retries=3 \
CMD curl -f http://localhost:7860/health || exit 1
# Launch FastAPI
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|