16 lines
452 B
Docker
16 lines
452 B
Docker
FROM python:3.12-slim AS build
|
|
WORKDIR /build
|
|
COPY requirements.txt .
|
|
RUN pip install --prefix=/install --no-cache-dir -r requirements.txt
|
|
|
|
FROM python:3.12-slim
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1
|
|
RUN useradd --system --uid 1000 --home /app --create-home app
|
|
WORKDIR /app
|
|
COPY --from=build /install /usr/local
|
|
COPY app ./app
|
|
USER app
|
|
EXPOSE 8000
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|