fixed docker specific paths so that everything works...

This commit is contained in:
Kikimanox
2022-08-29 15:20:21 +02:00
parent 748db5ad0f
commit 15fc2e0f62
2 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -8,4 +8,4 @@ services:
- 8080:8080 - 8080:8080
volumes: # when pushing to server, remove the first dot here in front of /mnt volumes: # when pushing to server, remove the first dot here in front of /mnt
- ./mnt/ssd/ds_ftp/classla_OS2022:/usr/src/app/classla_OS2022 - ./mnt/ssd/ds_ftp/classla_OS2022:/usr/src/app/classla_OS2022
- ./swagger_server/classla/classla_resources:/root/classla_resource - ./swagger_server/classla/classla_resources:/root/classla_resources
+11 -6
View File
@@ -2,13 +2,18 @@ from peewee import *
from datetime import datetime from datetime import datetime
import os import os
if not os.path.exists('requets_db/dbs'): LOCAL_PATH = "requets_db/dbs"
print("---!--- requests_db/dbs doesn't exist") SERVER_PATH = "swagger_server/requets_db/dbs"
print("lsing .")
print(os.listdir('.'))
os.mkdir('./requets_db/dbs')
DB = 'requets_db/dbs/jobs.db' if not os.path.exists(LOCAL_PATH):
if os.path.exists('requets_db'):
os.makedirs(LOCAL_PATH, exist_ok=True)
elif os.path.exists('swagger_server/requets_db'):
os.makedirs(SERVER_PATH, exist_ok=True)
DB = f'{LOCAL_PATH}/jobs.db'
if not os.path.exists(LOCAL_PATH):
DB = f'{SERVER_PATH}/jobs.db'
db = SqliteDatabase(DB, pragmas={ db = SqliteDatabase(DB, pragmas={
# 'journal_mode': 'wal', # 'journal_mode': 'wal',
'cache_size': -1 * 128 * 1024, # 128MB 'cache_size': -1 * 128 * 1024, # 128MB