diff --git a/dockerfile b/dockerfile index 530c789..b868de0 100644 --- a/dockerfile +++ b/dockerfile @@ -4,4 +4,5 @@ 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 diff --git a/scripts/create_database.py b/scripts/create_database.py index a15662e..f91a5d2 100644 --- a/scripts/create_database.py +++ b/scripts/create_database.py @@ -9,7 +9,7 @@ def create_connection(db_file): conn = sqlite3.connect(db_file) # Execute creation scripts - sql = open("create_tables.sql", "r"); + sql = open("scripts/create_tables.sql", "r"); conn.executescript(sql.read()) print(sqlite3.version) @@ -21,4 +21,4 @@ def create_connection(db_file): if __name__ == '__main__': - create_connection(r"../data/wmgzon.db") + create_connection(r"./data/wmgzon.db")