31 lines
687 B
Docker
31 lines
687 B
Docker
FROM python:3.12-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache build-base libffi-dev openssl-dev cargo
|
|
|
|
COPY pyproject.toml /app/pyproject.toml
|
|
COPY app /app/app
|
|
COPY scripts /app/scripts
|
|
COPY README.md /app/README.md
|
|
|
|
RUN pip install --no-cache-dir --upgrade pip && \
|
|
pip wheel --no-cache-dir --wheel-dir /wheels .
|
|
|
|
FROM python:3.12-alpine
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apk add --no-cache libstdc++ libffi openssl
|
|
|
|
COPY --from=builder /wheels /wheels
|
|
RUN pip install --no-cache-dir --upgrade pip && \
|
|
pip install --no-cache-dir /wheels/*
|
|
|
|
EXPOSE 8000
|
|
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]
|