Skip to content

Commit

Permalink
Working on getting migrations run in prod
Browse files Browse the repository at this point in the history
  • Loading branch information
le717 committed Oct 28, 2021
1 parent 17509df commit 6116f9a
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 57 deletions.
5 changes: 1 addition & 4 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,8 @@
.vscode/
.mypy_cache/
__pycache__/
database/
db/
tests/
testing/
node_modules/
*.md
.env
database.db
*.db
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
PYTHONPATH="."

FLASK_APP="wsgi.py"
FLASK_ENV="development"
SYS_VARS_PATH="./secrets"
SECRET_KEY="temporary secret key"

ENABLE_DISCORD_LOGGING="false"
DB_PATH="./database/database.db"
3 changes: 1 addition & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ ENV PYTHONPATH=/app \
SYS_VARS_PATH=/app/secrets \
FLASK_APP=wsgi.py \
TIMES_FAILED_THRESHOLD=10 \
ENABLE_DISCORD_LOGGING=false \
DB_PATH=./database/database.db
ENABLE_DISCORD_LOGGING=false

# Copy the app files into the container
RUN mkdir -p /app
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ services:
restart: unless-stopped
volumes:
- ./log:/app/log
- ./database:/app/db
- ./database:/app/database
ports:
- 127.0.0.1:5000:80
environment:
- FLASK_ENV=production
- TIMES_FAILED_THRESHOLD=5
- DB_PATH=/app/database/database.db
96 changes: 47 additions & 49 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions run-app.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#!/usr/bin/env bash
flask db migrate
gunicorn --bind 0.0.0.0:80 --workers 2 --log-level error --access-logfile /app/log/access.log --error-logfile /app/log/error.log wsgi:app
3 changes: 2 additions & 1 deletion src/core/database/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class WebLink(db.Model):
description = Column(String, nullable=False)
url = Column(String, nullable=False)
date_added = Column(DateTime, nullable=False)
rotted = Column(String, nullable=False, server_default="no")
is_dead = Column(Integer, nullable=False, server_default="0")
is_web_archive = Column(Integer, nullable=False, server_default="0")


class RottedLinks(db.Model):
Expand Down

0 comments on commit 6116f9a

Please sign in to comment.