mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-03 19:57:29 +01:00
Add reloading support to Docker container
This commit is contained in:
parent
095494f96f
commit
077bdeb01c
@ -25,7 +25,7 @@ from PIL import Image
|
|||||||
ALLOWED_RESOLUTIONS=[(100,67), (270,180), (350,233)]
|
ALLOWED_RESOLUTIONS=[(100,67), (270,180), (350,233)]
|
||||||
|
|
||||||
def mkdir(path):
|
def mkdir(path):
|
||||||
assert(path != "" and path is not None)
|
assert path != "" and path is not None
|
||||||
if not os.path.isdir(path):
|
if not os.path.isdir(path):
|
||||||
os.mkdir(path)
|
os.mkdir(path)
|
||||||
|
|
||||||
|
@ -752,7 +752,7 @@ class PackageRelease(db.Model):
|
|||||||
not self.package.checkPerm(user, Permission.APPROVE_RELEASE):
|
not self.package.checkPerm(user, Permission.APPROVE_RELEASE):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
assert(self.task_id is None and self.url is not None and self.url != "")
|
assert self.task_id is None and self.url is not None and self.url != ""
|
||||||
|
|
||||||
self.approved = True
|
self.approved = True
|
||||||
return True
|
return True
|
||||||
|
@ -121,7 +121,7 @@ def parseForumListPage(id, page, out, extra=None):
|
|||||||
|
|
||||||
if id in out:
|
if id in out:
|
||||||
print(" - got {} again, title: {}".format(id, title))
|
print(" - got {} again, title: {}".format(id, title))
|
||||||
assert(title == out[id]['title'])
|
assert title == out[id]['title']
|
||||||
return False
|
return False
|
||||||
|
|
||||||
row = {
|
row = {
|
||||||
|
@ -46,13 +46,13 @@ def randomString(n):
|
|||||||
return ''.join(random.choice(string.ascii_lowercase + \
|
return ''.join(random.choice(string.ascii_lowercase + \
|
||||||
string.ascii_uppercase + string.digits) for _ in range(n))
|
string.ascii_uppercase + string.digits) for _ in range(n))
|
||||||
|
|
||||||
assert(os.path.isdir(app.config["UPLOAD_DIR"]), "UPLOAD_DIR must exist")
|
|
||||||
|
|
||||||
def doFileUpload(file, fileType, fileTypeDesc):
|
def doFileUpload(file, fileType, fileTypeDesc):
|
||||||
if not file or file is None or file.filename == "":
|
if not file or file is None or file.filename == "":
|
||||||
flash("No selected file", "error")
|
flash("No selected file", "error")
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
assert os.path.isdir(app.config["UPLOAD_DIR"]), "UPLOAD_DIR must exist"
|
||||||
|
|
||||||
allowedExtensions = []
|
allowedExtensions = []
|
||||||
isImage = False
|
isImage = False
|
||||||
if fileType == "image":
|
if fileType == "image":
|
||||||
|
@ -22,6 +22,8 @@ services:
|
|||||||
- 5123:5123
|
- 5123:5123
|
||||||
volumes:
|
volumes:
|
||||||
- "./data/uploads:/var/cdb/uploads"
|
- "./data/uploads:/var/cdb/uploads"
|
||||||
|
- "./app:/source/app"
|
||||||
|
- "./migrations:/source/migrations"
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
- redis
|
- redis
|
||||||
@ -35,6 +37,7 @@ services:
|
|||||||
- FLASK_CONFIG=../config.cfg
|
- FLASK_CONFIG=../config.cfg
|
||||||
volumes:
|
volumes:
|
||||||
- "./data/uploads:/var/cdb/uploads"
|
- "./data/uploads:/var/cdb/uploads"
|
||||||
|
- "./app:/home/cdb/app"
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
|
|
||||||
|
3
utils/reload.sh
Executable file
3
utils/reload.sh
Executable file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
docker exec -it contentdb_app_1 sh -c "cp -r /source/* ."
|
Loading…
Reference in New Issue
Block a user