Spaces:
Sleeping
Sleeping
File size: 789 Bytes
1ef151b ddc8283 241955f 61054b9 ddc8283 241955f 1ef151b ddc8283 1ef151b ddc8283 1ef151b ddc8283 9e40862 1ef151b 9e40862 1ef151b | 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 | FROM python:3.9-slim
# Install basic dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Configure environment
ENV PYTHONUNBUFFERED=1
# Copy requirements first for better caching
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy all application files
COPY . .
# Create necessary directories
RUN mkdir -p logs state
# Make supervisor executable
RUN chmod +x supervisor.py
# Health check - ensure web UI is responding
HEALTHCHECK --interval=60s --timeout=30s --start-period=120s --retries=3 \
CMD python3 -c "import socket; s=socket.socket(); s.settimeout(2); s.connect(('localhost', 8000)); s.close()" || exit 1
# Start the application
CMD ["python3", "app.py"] |