From 83a7b195f20bcdf8f0fc6aa68006cc665e06cfad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Phillip=20K=C3=BChne?= Date: Sun, 26 May 2019 03:13:18 +0200 Subject: [PATCH] Add Docker, remove test data --- .gitignore | 3 ++- Dockerfile | 11 +++++++++++ database.py => app/database.py | 0 helpers.py => app/helpers.py | 2 +- main.py => app/main.py | 0 {static => app/static}/css/style.css | 0 {templates => app/templates}/base.html | 0 {templates => app/templates}/main.html | 0 {templates => app/templates}/main_admin.html | 0 {templates => app/templates}/songlist.html | 0 config.json | 4 ---- 11 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 Dockerfile rename database.py => app/database.py (100%) rename helpers.py => app/helpers.py (93%) rename main.py => app/main.py (100%) rename {static => app/static}/css/style.css (100%) rename {templates => app/templates}/base.html (100%) rename {templates => app/templates}/main.html (100%) rename {templates => app/templates}/main_admin.html (100%) rename {templates => app/templates}/songlist.html (100%) delete mode 100644 config.json diff --git a/.gitignore b/.gitignore index eb856be..efb242c 100644 --- a/.gitignore +++ b/.gitignore @@ -130,4 +130,5 @@ dmypy.json !.vscode/extensions.json # Test data -test.db \ No newline at end of file +test.db +config.json diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0e36a09 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM tiangolo/uwsgi-nginx-flask:python3.7 + +RUN pip install requests + +RUN pip install pandas + +RUN pip install Flask-BasicAuth + +RUN pip install bs4 + +COPY ./app /app \ No newline at end of file diff --git a/database.py b/app/database.py similarity index 100% rename from database.py rename to app/database.py diff --git a/helpers.py b/app/helpers.py similarity index 93% rename from helpers.py rename to app/helpers.py index 80af65f..d2a5e63 100644 --- a/helpers.py +++ b/app/helpers.py @@ -25,7 +25,7 @@ def setup_config(app): config = json.load(handle) print("Loaded existing config") else: - config = {'username': 'admin', 'password': 'Karaoke2019blubb'} + config = {'username': 'admin', 'password': 'changeme'} with open(config_file, 'w') as handle: json.dump(config, handle, indent=4, sort_keys=True) print("Wrote new config") diff --git a/main.py b/app/main.py similarity index 100% rename from main.py rename to app/main.py diff --git a/static/css/style.css b/app/static/css/style.css similarity index 100% rename from static/css/style.css rename to app/static/css/style.css diff --git a/templates/base.html b/app/templates/base.html similarity index 100% rename from templates/base.html rename to app/templates/base.html diff --git a/templates/main.html b/app/templates/main.html similarity index 100% rename from templates/main.html rename to app/templates/main.html diff --git a/templates/main_admin.html b/app/templates/main_admin.html similarity index 100% rename from templates/main_admin.html rename to app/templates/main_admin.html diff --git a/templates/songlist.html b/app/templates/songlist.html similarity index 100% rename from templates/songlist.html rename to app/templates/songlist.html diff --git a/config.json b/config.json deleted file mode 100644 index 14219c9..0000000 --- a/config.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "password": "w", - "username": "admin" -} \ No newline at end of file