dockerfile, fixing hardcoded url and cleanup

This commit is contained in:
Jan Dickmann 2024-06-30 12:40:39 +02:00
parent 11f051c7d9
commit 3e482d2e49
12 changed files with 246 additions and 255 deletions

View File

@ -657,5 +657,8 @@ def delete_all_entries():
# Close the session
db.session.close()
def create_app():
return app
if __name__ == '__main__':
app.run()

17
slaeforms/dockerfile Normal file
View File

@ -0,0 +1,17 @@
# Use the official Python image from the Docker Hub
FROM python:3.10-slim
# Set the working directory
WORKDIR /slaeforms
# Copy the rest of the application code to the working directory
COPY . .
# Install the dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Expose the port on which the app will run
EXPOSE 8000
# Define the command to run the application using Gunicorn
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "app:create_app()"]

View File

@ -0,0 +1,16 @@
blinker==1.8.2
click==8.1.7
colorama==0.4.6
Flask==3.0.3
Flask-SQLAlchemy==3.1.1
Flask-WTF==1.2.1
greenlet==3.0.3
gunicorn==22.0.0
itsdangerous==2.2.0
Jinja2==3.1.4
MarkupSafe==2.1.5
packaging==24.1
SQLAlchemy==2.0.30
typing_extensions==4.12.2
Werkzeug==3.0.3
WTForms==3.1.2

View File

@ -12,7 +12,7 @@
<div class="container">
<div class="login-container" >
<p>Some pages require you to be logged in.</p>
<form action="http://localhost:5000/login" method="post">
<form action="{{ url_for('login') }}" method="post">
<input class="login-elements" type="password" value="" name="password" placeholder="password">
<input class="login-elements" id="loginbutton" type="submit" value="submit";/>
</form></div>

View File

@ -39,7 +39,7 @@
If you have further questions, please send an email to testemail@notarealemail.deee
</p>
</div>
<form class="dsgvoform" action="http://localhost:5000/start" method="post">
<form class="dsgvoform" action="{{ url_for('startpage') }}" method="post">
<label for="terms-and-conditions">
<input class="inline" id="terms-and-conditions" type="checkbox" required name="terms-and-conditions" /> I accept the +terms and conditions
</label>

View File

@ -123,7 +123,7 @@ step={{question["step"]}}
<p>Error: Block {{ stimulus["type"] }} could not be loaded!</p>
{% endif %}
<form class="formlayout" id="question_form" action="http://localhost:5000/send" method="post">
<form class="formlayout" id="question_form" action="{{ url_for('sendpage') }}" method="post">
{% for question in questions %}
{% if (questions[question]["type"] == "likert") %}

View File

@ -10,7 +10,7 @@
<body>
<div class="container">
<h2>Hello! Thank you for participating in our study!</h2>
<form action="http://localhost:5000/start" method="post">
<form action="{{ url_for('startpage') }}" method="post">
<label for="terms-and-conditions">
<input class="inline" id="terms-and-conditions" type="checkbox" required name="terms-and-conditions" /> I accept the +terms and conditions</a>
</label>

View File

@ -1,20 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css')}}"" /> <!-- styles.css {{ url_for('static', filename='styles.css')}}-->
<title>Test Page 0 - Nothing</title>
<link rel="shortcut icon" href="{{ url_for('static', filename='icons/favicon.ico') }}">
</head>
<body>
<div class="container">
<p>This is just a test page for the single page option of the json configuration, but without something to submit</p>
<form action="http://localhost:5000/send_json" method="post">
<input type="hidden" name="submittedString" value="Hello, backend!">
<input id="submitbutton" type = "submit" value = "submit";/>
</form>
</div>
</body>
</html>

View File

@ -1,25 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="{{ url_for('static', filename='styles.css')}}"" /> <!-- styles.css {{ url_for('static', filename='styles.css')}}-->
<title>Test Page 1 - Datenschutzerklaerung</title>
<link rel="shortcut icon" href="{{ url_for('static', filename='favicon.ico') }}">
</head>
<body>
<div class="container">
<p>This is just a test page for the single page option of the json configuration</p>
<form action="http://localhost:5000/send_json" method="post">
<input
type="checkbox"
id="accepted"
name="accepted"
value="checked" />
<label for="accepted">Akzeptieren sie die Datenschutzerklaerung</label>
<p><input id="submitbutton" type = "submit" value = "submit";/></p>
</form>
</div>
</body>
</html>

View File

@ -32,7 +32,7 @@
</p>
</div>
<form class="dsgvoform" action="http://localhost:5000/start" method="post">
<form class="dsgvoform" action="{{ url_for('startpage') }}" method="post">
<label for="terms-and-conditions">
<input class="inline" id="terms-and-conditions" type="checkbox" required name="terms-and-conditions" /> I accept the +terms and conditions
</label>