-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Reduced size of docker image * Updated python image * Changed python image to alpine
- Loading branch information
Showing
1 changed file
with
17 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |