Update indexer to write sqlite db to persisted volume
This commit is contained in:
parent
7595af98f9
commit
ebf630df2d
@ -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
|
||||
|
@ -2,6 +2,8 @@ version: '2'
|
||||
services:
|
||||
main:
|
||||
build: .
|
||||
environment:
|
||||
SQLALCHEMY_DATABASE_URI: sqlite:///tokens.db
|
||||
volumes:
|
||||
- .:/usr/src/app
|
||||
ports:
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user