Spaces:
Sleeping
Sleeping
| # HuggingFace Spaces Dockerfile for Echo Environment | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy project files | |
| COPY . /app | |
| # Install Python dependencies | |
| RUN pip install --no-cache-dir -e . | |
| # HuggingFace Spaces uses port 7860 by default, but can be configured via PORT env var | |
| ENV PORT=7860 | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \ | |
| CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:${PORT}/health')" || exit 1 | |
| # Run the server on the configured port | |
| CMD uvicorn echo_env.server.app:app --host 0.0.0.0 --port ${PORT} | |