Skip to content

Commit

Permalink
Working? (2/2)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillNilges committed Sep 1, 2023
1 parent 5e06cf9 commit 1b6ceeb
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ RUN pip install .
# FIXME: This probably isn't the file structure we want.
COPY . .

ENTRYPOINT gunicorn 'meshdb:create_app()' --graceful-timeout 5 --bind=0.0.0.0:8080
ENTRYPOINT gunicorn 'meshdb:create_app()' --graceful-timeout 2 --bind=0.0.0.0:8080
4 changes: 4 additions & 0 deletions meshdb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ def create_app():
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = True
app.config["WTF_CSRF_ENABLED"] = False

# Configure Database
from meshdb.db.setup import setup_db
setup_db()

db.init_app(app)

import meshdb.auth.authmodels as authmodels
Expand Down
1 change: 1 addition & 0 deletions meshdb/db/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ def setup_db():
engine = create_db_engine() # TODO: Delete?

if not database_exists(engine.url):
print("Database not found. Bootstrapping....")
create_database(engine.url)
print(database_exists(engine.url))
meshdb.models.baseModel.Base.metadata.create_all(engine)
9 changes: 0 additions & 9 deletions wsgi.py

This file was deleted.

0 comments on commit 1b6ceeb

Please sign in to comment.