simplest flask server

This commit is contained in:
Andreas Balogh
2021-02-16 15:44:39 +01:00
parent 00a89222be
commit c1d80cabbd
14 changed files with 11 additions and 239 deletions

13
webui/Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM python:3.9-slim
RUN apt-get update && apt-get install -y \
gcc \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN pip install ZEO==5.2.1
RUN pip install flask
COPY . .
RUN chmod +x /tester.sh
RUN chmod +x /run.sh
ENV FLASK_APP=flaskr/zeo_db
EXPOSE 5000
ENTRYPOINT python3 -m flask run --host=0.0.0.0

8
webui/flaskr/hello.py Normal file
View File

@@ -0,0 +1,8 @@
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello World!\n'

1
webui/requirements.txt Normal file
View File

@@ -0,0 +1 @@
Flask

4
webui/run.sh Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
export FLASK_APP=flaskr/zeo_db
exec python3 -m flask run --host=0.0.0.0

2
webui/tester.sh Normal file
View File

@@ -0,0 +1,2 @@
mkdir var
wget webui:5000 -o var/index.html