Skip to content

Commit

Permalink
Reduced size of docker image (#117)
Browse files Browse the repository at this point in the history
* Reduced size of docker image

* Updated python image

* Changed python image to alpine
  • Loading branch information
purav10 authored Feb 18, 2025
1 parent f425dad commit 0224bb2
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit 0224bb2

Please sign in to comment.