File tree Expand file tree Collapse file tree 4 files changed +12
-8
lines changed
Expand file tree Collapse file tree 4 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 11from flask import Flask
2+ from waitress import serve
23
34app = Flask (__name__ )
45
5-
66@app .route ('/' )
77def hello ():
88 return "Hello World!"
99
1010if __name__ == '__main__' :
11- app . run ( port = 8080 , host = '0.0.0.0' )
11+ serve ( app , host = '0.0.0.0' , port = 8080 )
Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ components:
1818 image : buildguidanceimage-placeholder
1919 memoryLimit : 1024Mi
2020 endpoints :
21- - name : http-8080
22- targetPort : 8080
21+ - name : http-8081
22+ targetPort : 8081
2323 - name : py-web
2424 container :
2525 image : quay.io/eclipse/che-python-3.7:nightly
Original file line number Diff line number Diff line change 77#
88# Then run the container using:
99#
10- # docker run -i --rm -p 8080:8080 python/sample-basic
10+ # docker run -i --rm -p 8081:8081 python/sample-basic
1111# ###
1212FROM python:slim
1313
1414WORKDIR /projects
15- COPY . .
15+
16+ COPY requirements.txt requirements.txt
1617
1718RUN python3 -m venv venv
1819RUN . venv/bin/activate
1920RUN pip install -r requirements.txt
2021
21- EXPOSE 8080
22- CMD [ "python" , "app.py" ]
22+ COPY . .
23+
24+ EXPOSE 8081
25+ CMD [ "waitress-serve" , "--port=8081" , "app:app" ]
2326
Original file line number Diff line number Diff line change 11Flask == 1.1.2
2+ waitress == 2.0.0
You can’t perform that action at this time.
0 commit comments