Spaces:
Sleeping
Sleeping
| FROM ubuntu:22.04 | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| ENV PYTHONUNBUFFERED=1 | |
| # System dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| python3.11 \ | |
| python3.11-venv \ | |
| python3-pip \ | |
| curl \ | |
| wget \ | |
| lsof \ | |
| net-tools \ | |
| procps \ | |
| sed \ | |
| grep \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set python3.11 as default | |
| RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 1 && \ | |
| update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 | |
| # Install pip for python3.11 | |
| RUN python3 -m pip install --upgrade pip setuptools wheel | |
| # Pre-install common packages to speed up scenarios | |
| RUN pip install --no-cache-dir sqlalchemy | |
| # Create working directory | |
| RUN mkdir -p /app | |
| WORKDIR /app | |
| # Health check | |
| HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ | |
| CMD python3 -c "print('ok')" || exit 1 | |
| CMD ["sleep", "infinity"] | |