Added a working backend container
This commit is contained in:
parent
60415ad83f
commit
921544b76f
10 changed files with 143 additions and 16 deletions
|
@ -1,19 +1,11 @@
|
||||||
# For more information, please refer to https://aka.ms/vscode-docker-python
|
FROM python
|
||||||
FROM python:3.9
|
|
||||||
|
|
||||||
EXPOSE 5000
|
WORKDIR /opt/
|
||||||
|
|
||||||
# Keeps Python from generating .pyc files in the container
|
COPY requirements.txt .
|
||||||
ENV PYTHONDONTWRITEBYTECODE 1
|
|
||||||
|
|
||||||
# Turns off buffering for easier container logging
|
RUN pip install -r requirements.txt
|
||||||
ENV PYTHONUNBUFFERED 1
|
|
||||||
|
|
||||||
# Install pip requirements
|
COPY /src .
|
||||||
ADD requirements.txt .
|
|
||||||
RUN python -m pip install -r requirements.txt
|
|
||||||
|
|
||||||
WORKDIR /app
|
CMD [ "python", "app.py" ]
|
||||||
ADD . /app
|
|
||||||
|
|
||||||
CMD ["flask", "run"]
|
|
||||||
|
|
19
backend/Dockerfile.bak
Normal file
19
backend/Dockerfile.bak
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# For more information, please refer to https://aka.ms/vscode-docker-python
|
||||||
|
FROM python:3.9
|
||||||
|
|
||||||
|
#EXPOSE 5000
|
||||||
|
|
||||||
|
# Keeps Python from generating .pyc files in the container
|
||||||
|
#ENV PYTHONDONTWRITEBYTECODE 1
|
||||||
|
|
||||||
|
# Turns off buffering for easier container logging
|
||||||
|
# ENV PYTHONUNBUFFERED 1
|
||||||
|
|
||||||
|
# Install pip requirements
|
||||||
|
ADD requirements.txt .
|
||||||
|
RUN python -m pip install -r requirements.txt
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
ADD . /app
|
||||||
|
|
||||||
|
CMD ["flask", "run"]
|
12
backend/Dockerfile.prod
Normal file
12
backend/Dockerfile.prod
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
FROM python
|
||||||
|
|
||||||
|
WORKDIR /opt/demo/
|
||||||
|
|
||||||
|
COPY requirements.txt .
|
||||||
|
|
||||||
|
RUN apt-get -y update && apt-get -y upgrade
|
||||||
|
RUN pip install -r requirements.txt
|
||||||
|
|
||||||
|
COPY /src .
|
||||||
|
|
||||||
|
CMD [ "python", "main.py" ]
|
|
@ -1,7 +1,11 @@
|
||||||
click==7.1.2
|
click==7.1.2
|
||||||
Flask==1.1.2
|
Flask==1.1.2
|
||||||
|
Flask-Login==0.5.0
|
||||||
|
Flask-SQLAlchemy==2.5.1
|
||||||
|
greenlet==1.1.0
|
||||||
itsdangerous==1.1.0
|
itsdangerous==1.1.0
|
||||||
Jinja2==2.11.3
|
Jinja2==2.11.3
|
||||||
MarkupSafe==1.1.1
|
MarkupSafe==1.1.1
|
||||||
python-dotenv==0.17.1
|
python-dotenv==0.17.1
|
||||||
|
SQLAlchemy==1.4.15
|
||||||
Werkzeug==1.0.1
|
Werkzeug==1.0.1
|
||||||
|
|
|
@ -1,8 +1,34 @@
|
||||||
import time
|
import time
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
# Read environment variables
|
||||||
|
if "DEBUG" in os.environ and os.environ["DEBUG"] == 'yes':
|
||||||
|
debug = True
|
||||||
|
else:
|
||||||
|
debug = False
|
||||||
|
if "HOST" in os.environ:
|
||||||
|
host = os.environ["HOST"]
|
||||||
|
else:
|
||||||
|
host = '0.0.0.0'
|
||||||
|
if "PORT" in os.environ:
|
||||||
|
port = int(os.environ["PORT"])
|
||||||
|
else:
|
||||||
|
port = 5000
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@app.route('/')
|
||||||
|
def home():
|
||||||
|
return "Hello World"
|
||||||
|
|
||||||
@app.route('/time')
|
@app.route('/time')
|
||||||
def get_current_time():
|
def get_current_time():
|
||||||
return {'time': time.time()}
|
return {'time': time.time()}
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
app.run(debug=debug, host=host, port=port)
|
||||||
|
|
|
@ -24,5 +24,6 @@ services:
|
||||||
ports:
|
ports:
|
||||||
- 5000:5000
|
- 5000:5000
|
||||||
environment:
|
environment:
|
||||||
|
DEBUG: "yes"
|
||||||
PORT: 5000
|
PORT: 5000
|
||||||
FLASK_DEBUG: 1
|
HOST: "0.0.0.0"
|
||||||
|
|
30
frontend/issues.sh
Normal file
30
frontend/issues.sh
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
# Labels: backend, bug, content, design, duplicate, enhancement, frontend, help wanted, invalid, question, wontfix,
|
||||||
|
ISSUE_TITLE="Buttons gleichmässig darstellen"
|
||||||
|
DESC="Die Buttons sollen alle die gleiche Breite haben"
|
||||||
|
LABELS="design,frontend,enhancement"
|
||||||
|
DEADLINE="2021-06-23"
|
||||||
|
tea issue create --title "${ISSUE_TITLE}" --description "${DESC}" --labels "${LABELS}" --deadline "${DEADLINE}"
|
||||||
|
|
||||||
|
ISSUE_TITLE="login backend implementieren"
|
||||||
|
DESC=""
|
||||||
|
LABELS="backend,enhancement"
|
||||||
|
DEADLINE="2021-06-25"
|
||||||
|
tea issue create --title "${ISSUE_TITLE}" --description "${DESC}" --labels "${LABELS}" --deadline "${DEADLINE}"
|
||||||
|
|
||||||
|
ISSUE_TITLE="registrieren implementieren backend"
|
||||||
|
DESC=""
|
||||||
|
LABELS="backend,enhancement"
|
||||||
|
DEADLINE="2021-06-25"
|
||||||
|
tea issue create --title "${ISSUE_TITLE}" --description "${DESC}" --labels "${LABELS}" --deadline "${DEADLINE}"
|
||||||
|
|
||||||
|
ISSUE_TITLE="Umfrage erstellen (für neue Teilnehmer)"
|
||||||
|
DESC=""
|
||||||
|
LABELS="frontend,enhancement,backend"
|
||||||
|
DEADLINE="2021-06-25"
|
||||||
|
tea issue create --title "${ISSUE_TITLE}" --description "${DESC}" --labels "${LABELS}" --deadline "${DEADLINE}"
|
||||||
|
|
||||||
|
ISSUE_TITLE="Datenerhebung der Maus und Tastatur"
|
||||||
|
DESC=""
|
||||||
|
LABELS="frontend,backend,enhancement"
|
||||||
|
DEADLINE="2021-06-27"
|
||||||
|
tea issue create --title "${ISSUE_TITLE}" --description "${DESC}" --labels "${LABELS}" --deadline "${DEADLINE}"
|
|
@ -39,5 +39,5 @@
|
||||||
"last 1 safari version"
|
"last 1 safari version"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"proxy": "http://127.0.0.1:5000"
|
"proxy": "http://localhost:5000"
|
||||||
}
|
}
|
||||||
|
|
12
frontend/src/components/pages/Manual.js
Normal file
12
frontend/src/components/pages/Manual.js
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
import React from "react";
|
||||||
|
import "../../App.css";
|
||||||
|
import Footer from "../../Footer";
|
||||||
|
|
||||||
|
export default function Manual() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<h2 className="about">Anleitung / Bedienungshinweise</h2>
|
||||||
|
<Footer />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
31
frontend/src/components/pages/Register.js
Normal file
31
frontend/src/components/pages/Register.js
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
import React from "react";
|
||||||
|
import "../../App.css";
|
||||||
|
import Footer from "../../Footer";
|
||||||
|
import InputField from "../InputField";
|
||||||
|
import SubmitField from "../SubmitField";
|
||||||
|
|
||||||
|
export default function Login() {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<div className="sitePage">
|
||||||
|
<h1>Registrierung</h1>
|
||||||
|
<p>Herzlich willkommen bei meiner Bachelorarbeit. Du kannst dich hier einfach registrieren, sodass du mir ein positives Feedback hinterlassen kannst. Bei der ersten Registrierung geht es darum, dass ich ein paar Sachen über dich kennenlerne. Ich werde diese Fragen strikt trennen mit der eigentlichen Fragestellung. Diese Fragen dienen mir dazu, dass ich einschätzen kann, welche Leute ich befragt habe.</p>
|
||||||
|
<form>
|
||||||
|
<InputField
|
||||||
|
LabelName="Benutzername / Kennung"
|
||||||
|
InputType=""
|
||||||
|
InputName="username"
|
||||||
|
/>
|
||||||
|
<InputField
|
||||||
|
LabelName="Passwort"
|
||||||
|
InputType="password"
|
||||||
|
InputName="password"
|
||||||
|
/>
|
||||||
|
<br />
|
||||||
|
<SubmitField LabelName="Einloggen" />
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
<Footer />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
Loading…
Reference in a new issue