commit 701a13f636973c237365ff659c055d04b3162597 Author: Jon Date: Tue Sep 29 22:06:47 2020 +0000 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..82adb58 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +__pycache__ +venv diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..dcfdf0b --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/app.py b/app.py new file mode 100644 index 0000000..5957624 --- /dev/null +++ b/app.py @@ -0,0 +1,13 @@ +from flask import Flask +app = Flask(__name__) + +@app.route('/') +def hello(): + return "Hello There, World!" + +@app.route('/') +def hello_stranger(name=None): + return "Hello, %s!" % name + +if __name__ == '__main__': + app.run() diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..41959c7 --- /dev/null +++ b/requirements.txt @@ -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 diff --git a/service.yaml b/service.yaml new file mode 100644 index 0000000..91cc14e --- /dev/null +++ b/service.yaml @@ -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