Skip to content

Commit 2370a91

Browse files
author
Antonin
committed
🚧 edit Dockerfile
1 parent af450dc commit 2370a91

1 file changed

Lines changed: 18 additions & 11 deletions

File tree

Dockerfile

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,21 @@
1-
FROM python:3-slim AS builder
2-
ADD . /app
3-
WORKDIR /app
1+
#Deriving the latest base image
2+
FROM python:slim-buster
3+
4+
5+
#Labels as key value pair
6+
LABEL Maintainer="roushan.me17"
7+
8+
9+
# Any working directory can be chosen as per choice like '/' or '/home' etc
10+
# i have chosen /usr/app/src
11+
WORKDIR /
12+
13+
#to COPY the remote file at working directory in container
14+
COPY * ./
15+
# Now the structure looks like this '/usr/app/src/test.py'
416

5-
# We are installing a dependency here directly into our app source dir
617
RUN pip install -r requirements.txt
18+
#CMD instruction should be used to run the software
19+
#contained by your image, along with any arguments.
720

8-
# A distroless container image with Python and some basics like SSL certificates
9-
# https://github.com/GoogleContainerTools/distroless
10-
FROM gcr.io/distroless/python3-debian10
11-
COPY --from=builder /app /app
12-
WORKDIR /app
13-
ENV PYTHONPATH /app
14-
CMD ["/cmd/main.py"]
21+
CMD [ "python3", "./main.py"]

0 commit comments

Comments
 (0)