-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Antonin
committed
Aug 21, 2022
1 parent
af450dc
commit 2370a91
Showing
1 changed file
with
18 additions
and
11 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,14 +1,21 @@ | ||
FROM python:3-slim AS builder | ||
ADD . /app | ||
WORKDIR /app | ||
#Deriving the latest base image | ||
FROM python:slim-buster | ||
|
||
|
||
#Labels as key value pair | ||
LABEL Maintainer="roushan.me17" | ||
|
||
|
||
# Any working directory can be chosen as per choice like '/' or '/home' etc | ||
# i have chosen /usr/app/src | ||
WORKDIR / | ||
|
||
#to COPY the remote file at working directory in container | ||
COPY * ./ | ||
# Now the structure looks like this '/usr/app/src/test.py' | ||
|
||
# We are installing a dependency here directly into our app source dir | ||
RUN pip install -r requirements.txt | ||
#CMD instruction should be used to run the software | ||
#contained by your image, along with any arguments. | ||
|
||
# A distroless container image with Python and some basics like SSL certificates | ||
# https://github.com/GoogleContainerTools/distroless | ||
FROM gcr.io/distroless/python3-debian10 | ||
COPY --from=builder /app /app | ||
WORKDIR /app | ||
ENV PYTHONPATH /app | ||
CMD ["/cmd/main.py"] | ||
CMD [ "python3", "./main.py"] |