- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
Latest commit
12 lines (12 loc) · 610 Bytes
/
Copy pathDockerfile
File metadata and controls
12 lines (12 loc) · 610 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
FROM python:3.12-slim
ENV PYTHONDONTWRITEBYTECODE=1 PYTHONUNBUFFERED=1
RUN groupadd --system sky && useradd --system --gid sky --home-dir /app sky
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
COPY src ./src
RUN mkdir -p /app/data && chown -R sky:sky /app
USER sky
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/healthz', timeout=3)"
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000"]