Spaces:
Sleeping
Sleeping
File size: 587 Bytes
fee8744 1e1ca31 fee8744 1e1ca31 fee8744 1e1ca31 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | FROM python:3.11-slim
WORKDIR /app
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY environment/ ./environment/
COPY server/ ./server/
COPY openenv.yaml .
COPY inference.py .
COPY pyproject.toml .
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860/health')" || exit 1
# Run Flask app on port 7860 (HF Space standard)
EXPOSE 7860
ENV PORT=7860
CMD ["python", "-m", "server.app"]
|