This commit is contained in:
Jon
2020-09-29 22:06:47 +00:00
commit 701a13f636
5 changed files with 48 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
__pycache__
venv

14
Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM python:3.7-alpine
COPY requirements.txt /
RUN pip install -r /requirements.txt
COPY app.py app/app.py
WORKDIR /app
EXPOSE 8000
#CMD ["gunicorn", "-b 0.0.0.0:8000", "-w 4", "app:app"]
ENTRYPOINT ["gunicorn", "-b 0.0.0.0:8000", "-w 4", "app:app"]
#CMD ["gunicorn", "-w 4", "app:app"]

13
app.py Normal file
View File

@@ -0,0 +1,13 @@
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return "Hello There, World!"
@app.route('/<name>')
def hello_stranger(name=None):
return "Hello, %s!" % name
if __name__ == '__main__':
app.run()

7
requirements.txt Normal file
View File

@@ -0,0 +1,7 @@
click==7.1.2
Flask==1.1.2
gunicorn==20.0.4
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
Werkzeug==1.0.1

12
service.yaml Normal file
View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: test-service
spec:
selector:
app: test-app
ports:
- protocol: TCP
port: 80
targetPort: 8000
type: LoadBalancer