We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 524713f commit 04dcf42Copy full SHA for 04dcf42
app.py
@@ -1,4 +1,5 @@
1
from flask import Flask
2
+import os
3
4
app = Flask(__name__)
5
@@ -7,4 +8,9 @@ def hello():
7
8
return "Hello World!"
9
10
if __name__ == '__main__':
- app.run(port=8080,host='0.0.0.0')
11
+ port = int(os.environ.get('FLASK_PORT'))
12
+
13
+ if port == None:
14
+ port = 8080
15
16
+ app.run(port=port,host='0.0.0.0')
docker/Dockerfile
@@ -2,6 +2,7 @@ FROM python:slim
# By default, listen on port 8081
EXPOSE 8081/tcp
+ENV FLASK_PORT=8081
6
# Set the working directory in the container
WORKDIR /projects
0 commit comments