diff --git a/Dockerfile b/Dockerfile index f4061d4..3b49f63 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,29 @@ -FROM python:3.11 +FROM python:3.11-alpine AS builder ENV PYTHONUNBUFFERED 1 WORKDIR /app -COPY ./requirements.txt /app/requirements.txt +RUN apk add --no-cache gcc musl-dev python3-dev libffi-dev -RUN pip install -r requirements.txt +COPY ./requirements.txt /app/requirements.txt +RUN pip install --no-cache-dir --prefix=/install -r requirements.txt COPY . /app -COPY ./entrypoint.sh /app/entrypoint.sh - RUN chmod +x /app/entrypoint.sh + +FROM python:3.11-alpine + +ENV PYTHONUNBUFFERED 1 + +WORKDIR /app + +RUN apk add --no-cache libffi + +COPY --from=builder /install /usr/local +COPY --from=builder /app /app + # Set the entrypoint to the entrypoint.sh script -ENTRYPOINT ["/app/entrypoint.sh"] +ENTRYPOINT ["/app/entrypoint.sh"] \ No newline at end of file