fix: mount quest function

This commit is contained in:
Lin, Hung-Shin committed 2023-11-22 10:40:15 +08:00
1 parent 06c36565d0
commit 2c4bd67996
3 files changed
+9 -6

No files matched your search

+1 -1
View File
@@ -25,7 +25,6 @@ const config = {
db: get('MONGO_URL', 'mongodb://localhost:27017/odyssey-test'),
secret: get('SECRET_KEY', ''),
isProduction: process.env.NODE_ENV === 'production',
hostPwd: get('HOST_PWD', ''),
containerExpiry: get('EXPIRY', 1000 * 60 * 60),
sessionMaxAge: get('SESSION_MAX_AGE', 1000 * 60 * 60 * 24 * 7),
google: {
@@ -45,6 +44,7 @@ const config = {
defaultImage: get('QUEST_IMAGE', 'linuxodyssey/quest-base'),
imagePrefix: get('DOCKER_PREFIX', 'linuxodyssey/quest-'),
mountQuest: get('MOUNT_QUEST', ''),
hostPwd: get('HOST_PWD', ''),
},
}
+6 -4
View File
@@ -23,10 +23,12 @@ export function createContainer(name, questId) {
name,
Image: getQuestImage(questId),
}
if (!config.isProduction && config.hostPwd && config.mountQuest) {
option.HostConfig.Bind = [
`${config.hostPwd}/quests/${config.mountQuest}/home:/home/commander`,
`${config.hostPwd}/packages/container:/usr/local/lib/container`,
const { hostPwd, mountQuest } = config.docker
if (!config.isProduction && hostPwd && mountQuest) {
console.log('Mounting quest folder', mountQuest)
option.HostConfig.Binds = [
`${hostPwd}/quests/${mountQuest}/home:/home/commander`,
`${hostPwd}/packages/container:/usr/local/lib/container`,
]
}
return engine.createContainer(option)