FROM python@sha256:a1165e272e578941b84abc79e4ab38a0305cd12803a5c4247979ac7655f4d641
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1 PIP_DISABLE_PIP_VERSION_CHECK=1
WORKDIR /app
COPY requirements.lock ./
RUN pip install --no-cache-dir --only-binary=:all: --no-deps -r requirements.lock && pip check
COPY app.py device_groups.py google_accounts.py google_accounts.sql manage.py schema.sql ./
COPY web ./web
USER 10001:10001
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:21800/health',timeout=3).read()"
CMD ["uvicorn", "app:app", "--host", "127.0.0.1", "--port", "21800", "--workers", "1", "--no-access-log", "--proxy-headers", "--forwarded-allow-ips", "127.0.0.1", "--limit-concurrency", "64", "--timeout-keep-alive", "5"]
