move database.sqlite to separate directory
Makes it easier to mount a volume and get persistence.
This commit is contained in:
@@ -13,7 +13,7 @@ COPY main.py .
|
||||
COPY api.py .
|
||||
COPY moj_licznik.py .
|
||||
COPY log_config.py .
|
||||
COPY database_empty.sqlite database.sqlite
|
||||
COPY database_empty.sqlite data/database.sqlite
|
||||
RUN chmod a+x run.sh
|
||||
|
||||
RUN apk add --update --no-cache py3-pip && \
|
||||
|
||||
@@ -11,7 +11,7 @@ logger = logging.getLogger("energaMeter.api")
|
||||
|
||||
|
||||
path = os.path.dirname(os.path.abspath(__file__))
|
||||
db_file = 'database.sqlite'
|
||||
db_file = 'data/database.sqlite'
|
||||
db = SqliteDatabase(os.path.join(path, db_file))
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
@@ -11,7 +11,7 @@ import urllib.parse
|
||||
logger = logging.getLogger("energaMeter")
|
||||
|
||||
path = os.path.dirname(os.path.abspath(__file__))
|
||||
db_file = 'database.sqlite'
|
||||
db_file = 'data/database.sqlite'
|
||||
db = SqliteDatabase(os.path.join(path, db_file))
|
||||
|
||||
class ChartType(Enum):
|
||||
@@ -603,4 +603,4 @@ class MojLicznik:
|
||||
if zone == "zone3":
|
||||
pPETable = PPETable.get(PPETable.id == meter_id)
|
||||
return pPETable.zone3
|
||||
return None
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user