File tree Expand file tree Collapse file tree 4 files changed +12
-23
lines changed
Expand file tree Collapse file tree 4 files changed +12
-23
lines changed Original file line number Diff line number Diff line change 11from flask import Flask
2- from waitress import serve
32
43app = Flask (__name__ )
54
@@ -8,4 +7,4 @@ def hello():
87 return "Hello World!"
98
109if __name__ == '__main__' :
11- serve ( app , host = '0.0.0.0' , port = 8080 )
10+ app . run ( port = 8080 , host = '0.0.0.0' )
Original file line number Diff line number Diff line change 1- # ###
2- # This Dockerfile is used in order to build a container that runs the Spring Boot application
3- #
4- # Build the image with:
5- #
6- # docker build -f docker/Dockerfile -t python/sample-basic .
7- #
8- # Then run the container using:
9- #
10- # docker run -i --rm -p 8081:8081 python/sample-basic
11- # ###
121FROM python:slim
132
14- WORKDIR /projects
3+ # By default, listen on port 8081
4+ EXPOSE 8081/tcp
155
16- RUN python3 -m venv venv
17- RUN . venv/bin/activate
6+ # Set the working directory in the container
7+ WORKDIR /projects
188
19- # optimize image caching
9+ # Copy the dependencies file to the working directory
2010COPY requirements.txt .
11+
12+ # Install any dependencies
2113RUN pip install -r requirements.txt
2214
15+ # Copy the content of the local src directory to the working directory
2316COPY . .
2417
25- EXPOSE 8081
26- CMD [ "waitress-serve" , "--port=8081" , "app:app" ]
27-
18+ # Specify the command to run on container start
19+ CMD [ "python" , "./app.py" ]
Original file line number Diff line number Diff line change 1- Flask == 2.0.0
2- itsdangerous == 2.0.1
3- waitress == 2.0.0
1+ Flask == 2.1.0
You can’t perform that action at this time.
0 commit comments