From cc6bb6574a50cb52c2b22f7950eda2b7f7c3603e Mon Sep 17 00:00:00 2001 From: Assir Abdukhalikov Date: Thu, 16 Oct 2025 13:11:16 +0500 Subject: [PATCH] fix Dockerfile --- Dockerfile | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 169a640..02c7597 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,15 +1,25 @@ -FROM python:3.14-slim +FROM python:3.12-slim -WORKDIR /code +# Prevents Python from writing .pyc files & forces unbuffered logs +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 \ + PIP_NO_CACHE_DIR=1 -COPY ./requirements.txt ./ +WORKDIR /code +COPY ./requirements.txt . -RUN apt-get update && apt-get install git -y && apt-get install curl -y +# Install minimal build deps in one layer; clean apt cache +RUN apt-get update \ + && apt-get install -y --no-install-recommends \ + gcc g++ make cmake pkg-config git curl \ + && rm -rf /var/lib/apt/lists/* -RUN pip install --no-cache-dir -r requirements.txt +# Upgrade build tooling, then install deps +RUN python -m pip install --upgrade pip setuptools wheel \ + && pip install -r requirements.txt +# Copy app code COPY ./src ./src EXPOSE 8000 - -CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] +CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "8000", "--reload"] \ No newline at end of file