File size: 858 Bytes
9b9c562
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9496a0e
 
9b9c562
c2fa0f1
9b9c562
9496a0e
 
 
 
 
 
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
FROM python:3.10-slim

# Install system dependencies
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*

WORKDIR /app

# Install dependencies
COPY requirements.txt /tmp/requirements.txt
RUN pip install --no-cache-dir -r /tmp/requirements.txt && rm /tmp/requirements.txt

# Copy environment code
COPY . /app/

# Environment configurations setup
ENV PYTHONPATH="/app"
# Hugging Face Spaces may set PORT; must match README `app_port` (7860).
ENV PORT=7860

EXPOSE 7860

# Health check uses same default PORT as CMD (Spaces usually leave PORT=7860)
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=5 \
    CMD sh -c 'curl -fsS "http://127.0.0.1:${PORT}/health" || exit 1'

# OpenEnv app: FastAPI ASGI at server.app:app (see openenv.yaml)
CMD ["sh", "-c", "exec uvicorn server.app:app --host 0.0.0.0 --port ${PORT}"]