fix Dockerfile
This commit is contained in:
22
Dockerfile
22
Dockerfile
@@ -1,15 +1,25 @@
|
||||
FROM python:3.14-slim
|
||||
FROM python:3.12-slim
|
||||
|
||||
# Prevents Python from writing .pyc files & forces unbuffered logs
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PIP_NO_CACHE_DIR=1
|
||||
|
||||
WORKDIR /code
|
||||
COPY ./requirements.txt .
|
||||
|
||||
COPY ./requirements.txt ./
|
||||
# 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 apt-get update && apt-get install git -y && apt-get install curl -y
|
||||
|
||||
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"]
|
||||
Reference in New Issue
Block a user