init
This commit is contained in:
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
__pycache__
|
||||||
|
venv
|
||||||
14
Dockerfile
Normal file
14
Dockerfile
Normal 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
13
app.py
Normal 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
7
requirements.txt
Normal 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
12
service.yaml
Normal 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
|
||||||
Reference in New Issue
Block a user