fix Dockerfile

This commit is contained in:
Assir Abdukhalikov
2025-10-16 13:11:16 +05:00
parent 06e587cb0c
commit cc6bb6574a

View File

@@ -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"]