diff --git a/app.py b/app.py index 83d4724..6e2f70d 100644 --- a/app.py +++ b/app.py @@ -15,7 +15,7 @@ def main(): if secret_key == None: # NO Secret Key set! print("No app secret set, please set one before deploying in production") - app.secret_key = "DEFUALTKEY" + app.secret_key = "DEFAULTKEY" else: app.secret_key = secret_key diff --git a/docker-compose.yml b/docker-compose.yml index 18cb398..dd084ea 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,7 +4,11 @@ services: wmgzon: container_name: "wmgzon" build: . + environment: + - APPSECRET=test ports: - - "5000:5000" + - "5000:5000" volumes: - - .:/code \ No newline at end of file + - .:/app + restart: unless-stopped + \ No newline at end of file diff --git a/dockerfile b/dockerfile index b868de0..d0ff9e5 100644 --- a/dockerfile +++ b/dockerfile @@ -3,6 +3,4 @@ COPY ./requirements.txt /app/requirements.txt WORKDIR /app RUN pip install -r requirements.txt COPY . /app -ENTRYPOINT [ "python" ] -RUN ["scripts/create_database.py"] -CMD ["app.py" ] \ No newline at end of file +CMD ["scripts/run.sh"] \ No newline at end of file diff --git a/scripts/create_database.py b/scripts/create_database.py index f91a5d2..61046f6 100644 --- a/scripts/create_database.py +++ b/scripts/create_database.py @@ -6,13 +6,15 @@ def create_connection(db_file): """ create a database connection to a SQLite database """ conn = None try: + print("Opening Database file and ensuring table integrity") conn = sqlite3.connect(db_file) # Execute creation scripts sql = open("scripts/create_tables.sql", "r"); conn.executescript(sql.read()) - - print(sqlite3.version) + + print("SQLite Version: " + sqlite3.version) + print("Table creation complete") except Error as e: print(e) finally: diff --git a/scripts/run.sh b/scripts/run.sh new file mode 100644 index 0000000..5a50f62 --- /dev/null +++ b/scripts/run.sh @@ -0,0 +1,4 @@ +#! /bin/sh + +python ./scripts/create_database.py +python ./app.py \ No newline at end of file diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh deleted file mode 100644 index e69de29..0000000