Spaces:
Build error
Build error
File size: 716 Bytes
c8e832f 1c8b7f1 c8e832f 1c8b7f1 c8e832f 1c8b7f1 c8e832f 1c8b7f1 c8e832f 1c8b7f1 c8e832f 1c8b7f1 c8e832f 1c8b7f1 c8e832f | 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 | FROM python:3.11-slim
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
git \
curl \
&& rm -rf /var/lib/apt/lists/*
# Copy source code
COPY . /app
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV HOST=0.0.0.0
ENV PORT=8000
ENV WORKERS=1
ENV MAX_CONCURRENT_ENVS=16
# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
CMD curl -f http://localhost:${PORT}/health || exit 1
# Run FastAPI app
EXPOSE ${PORT}
ENV ENABLE_WEB_INTERFACE=true
CMD ["python", "-m", "server.app"]
|