Adapted database scripts to be run from the root directoryt

This commit is contained in:
Luke Else 2024-01-01 16:25:58 +00:00
parent fbe7219af2
commit 59d379f657
2 changed files with 3 additions and 2 deletions

View File

@ -4,4 +4,5 @@ WORKDIR /app
RUN pip install -r requirements.txt RUN pip install -r requirements.txt
COPY . /app COPY . /app
ENTRYPOINT [ "python" ] ENTRYPOINT [ "python" ]
RUN ["scripts/create_database.py"]
CMD ["app.py" ] CMD ["app.py" ]

View File

@ -9,7 +9,7 @@ def create_connection(db_file):
conn = sqlite3.connect(db_file) conn = sqlite3.connect(db_file)
# Execute creation scripts # Execute creation scripts
sql = open("create_tables.sql", "r"); sql = open("scripts/create_tables.sql", "r");
conn.executescript(sql.read()) conn.executescript(sql.read())
print(sqlite3.version) print(sqlite3.version)
@ -21,4 +21,4 @@ def create_connection(db_file):
if __name__ == '__main__': if __name__ == '__main__':
create_connection(r"../data/wmgzon.db") create_connection(r"./data/wmgzon.db")