Skip to content

Commit

Permalink
🚧 edit Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Antonin committed Aug 21, 2022
1 parent af450dc commit 2370a91
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions Dockerfile
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"]

0 comments on commit 2370a91

Please sign in to comment.