Commit d8c863e2 authored by Lukas Bhm's avatar Lukas Bhm
Browse files

use .env files

parent 91c542df
......@@ -16,4 +16,4 @@ ENV FLASK_APP chiefsend.py
EXPOSE 5000
EXPOSE 6379
ENTRYPOINT gunicorn -b :5000 --workers=3 --worker-class=tornado --timeout=90 --graceful-timeout=30 --log-level=DEBUG --access-logfile - --error-logfile - chiefsend:app
ENTRYPOINT gunicorn -b :5000 --workers=3 --timeout=90 --graceful-timeout=30 --log-level=DEBUG --access-logfile - --error-logfile - chiefsend:app
......@@ -4,11 +4,8 @@ from flask_sqlalchemy import SQLAlchemy
from redis import Redis
from rq import Queue
print('WE GOIN IN BOIS')
basedir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
datadir = os.path.abspath(os.path.join(basedir, 'data'))
print(basedir)
print(datadir)
app = Flask(__name__)
app.config['SECRET_KEY'] = os.getenv('SECRET_KEY') or 'jonas ist ein kek'
......@@ -16,13 +13,13 @@ app.config['MEDIA_LOCATION'] = os.getenv('MEDIA_LOCATION') or os.path.join(datad
app.config['SQLALCHEMY_DATABASE_URI'] = os.getenv('DATABASE_URI') or 'sqlite:///' + os.path.join(datadir, 'home.db')
app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
app.config['MAX_MEDIA_SIZE'] = 1000 * 1024 * 1024 # 1000 MB
app.config['REDIS_CONNECTION'] = os.getenv('REDIS_URL') or 'redis://'
db = SQLAlchemy(app)
#task_queue = Queue(connection=Redis.from_url('redis://chiefsend-redis'))
task_queue = Queue(connection=Redis())
from app.models import *
task_queue = Queue(connection=Redis.from_url(app.config['REDIS_CONNECTION']))
from app.models import *
db.create_all()
db.session.commit()
......
......@@ -20,7 +20,7 @@ services:
- type: volume
source: chiefsend-vol
target: /home/chiefsend/data
entrypoint: rq worker --with-scheduler --url redis://chiefsend-redis # connect to redis hostname
entrypoint: rq worker --with-scheduler --url ${REDIS_URL} # connect to redis hostname
web:
container_name: "chiefsend-web"
......@@ -33,6 +33,5 @@ services:
source: chiefsend-vol
target: /home/chiefsend/data
volumes:
chiefsend-vol:
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment