From 2dfd6fbbc83c007fc3ae59fd82594be3e7885a9d Mon Sep 17 00:00:00 2001 From: pstruebi Date: Sun, 23 Jun 2024 21:20:03 +0200 Subject: [PATCH] Add docker compose build file --- Dockerfile | 14 ++++++++++++++ config.py | 4 ++-- database/users.initialized copy.db | Bin 0 -> 16384 bytes db.py | 22 +++++++++++++++++++++- docker-compose.yaml | 14 ++++++++++++++ requirements.txt | 21 +++++++++++++++++++-- run_production_server.sh | 4 ++++ users.db.backup.txt | 2 -- 8 files changed, 74 insertions(+), 7 deletions(-) create mode 100644 Dockerfile create mode 100644 database/users.initialized copy.db create mode 100644 docker-compose.yaml create mode 100644 run_production_server.sh diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..fe0b486 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,14 @@ +# Use an official Python runtime as a parent image +FROM python:3.10 + +# Set the working directory in the container to /app +WORKDIR /app + +# Copy the current directory contents into the container at /app +COPY . /app + +# Install any needed packages specified in requirements.txt +RUN pip install --no-cache-dir -r requirements.txt + +# Make port 80 available to the world outside this container +EXPOSE 8000 diff --git a/config.py b/config.py index 793c60e..d7ebd39 100644 --- a/config.py +++ b/config.py @@ -1,7 +1,7 @@ class DefaultConfig: DEBUG = False TESTING = False - DATABASE_URI = "users.db" + DATABASE_URI = "./database/users.db" SECRET_KEY = SECURITY_PASSWORD_SALT='default' CONFIRMATATION_EMAIL_ADD=None @@ -11,7 +11,7 @@ class Config(DefaultConfig): class ProductionConfig(Config): SECRET_KEY = '\xacI4\x077\x16?Q\xb4")\xdb\x066\x95\x11i\x0b\x0c&\xb6rP\'' SECURITY_PASSWORD_SALT = '>\xe3\x9bz\xfd\xbc[\xe22\xcfK\xca\x88!\xd8\xd5,\xd0\x95\x0c\x02\xad\xfa\x9d' - DATABASE_URI = '/home/site/wwwroot/users.db' # For azure app services. The content under wwwroot is durable, unless you delete your app service. + DATABASE_URI = './users.db' # For azure app services. The content under wwwroot is durable, unless you delete your app service. class DevelopmentConfig(Config): CONFIRMATATION_EMAIL_ADD= "struebin.patrick@gmail.com" diff --git a/database/users.initialized copy.db b/database/users.initialized copy.db new file mode 100644 index 0000000000000000000000000000000000000000..62948a14be3d702479dda6db3c9ebc3b679e21d2 GIT binary patch literal 16384 zcmeI(%TC)s6b9fiq1+@$H&IqdBNeGoAhMmi zBJSFJU%5*>u+5Od+1vH(PmyJJAOHafKmY;|fB*y_009X6hXTi$ zrTp%$(n(owz?1WVn5K3Uem>`+g`KQ5G8e|;q8fWvOu1K zdd>%rHku;Zt}8Qq$fCjR?slVg(su4;CoD-W#&Pg_oj)FhQ9R@UJ#02z$8ONq&XL`A zJ$hujr;a@IYzRxE@u(XxF@u+9U)y>9WGVkLr;unA@Gmn6HciJj{jR*!t|r%VF25ol zs&x@c_LPVP4FV8=00bZa0SG_<0uX=z1Rwx`e;2rXp{$Ti`?9lYPm(mA@?JFCj0zK$ z#*yDY_#|Hq6#VgU((4DIUQIqT-7u@VsfxB0v$|D>$