Update indexer to write sqlite db to persisted volume

This commit is contained in:
IamTheFij 2018-02-05 17:55:07 -08:00
parent 7595af98f9
commit ebf630df2d
3 changed files with 10 additions and 3 deletions

View File

@ -1,6 +1,9 @@
FROM python:3.6-onbuild
# ENV FLASK_APP=indexer/app.py
RUN mkdir -p /config
VOLUME /config
ENV SQLALCHEMY_DATABASE_URI sqlite:////config/tokens.db
ENV FLASK_DEBUG=1
EXPOSE 5000

View File

@ -2,6 +2,8 @@ version: '2'
services:
main:
build: .
environment:
SQLALCHEMY_DATABASE_URI: sqlite:///tokens.db
volumes:
- .:/usr/src/app
ports:

View File

@ -9,8 +9,10 @@ import flask
app = flask.Flask(__name__)
# TODO: use a real database or something
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get('DATABASE_URI', 'sqlite:///tokens.db')
app.config['SQLALCHEMY_DATABASE_URI'] = os.environ.get(
'DATABASE_URI',
'sqlite:///tokens.db'
)
app.config['SQLALCHEMY_ECHO'] = True
app.config['DEBUG'] = True