Spaces:
Sleeping
Sleeping
File size: 755 Bytes
5716a3a 2194233 51264be 5716a3a 2194233 5716a3a | 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 | FROM python:3.11-slim
# metadata
LABEL name="sql-correction-env"
LABEL version="1.0"
LABEL description="OpenEnv SQL Query Correction RL Environment"
WORKDIR /app
# install deps first for better layer caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# copy project
COPY . .
# HF Spaces expects port 7860
EXPOSE 7860
# health check so HF Space knows when it's ready
HEALTHCHECK --interval=10s --timeout=5s --start-period=15s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health', timeout=3)"
# server:app refers to the root server.py which re-exports app from sql_env.server
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"]
|