mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-08 03:20:12 +08:00
fix: mount quest function
This commit is contained in:
1 parent
06c36565d0
commit
2c4bd67996
3 files changed
+9
-6
No files matched your search
+2
-1
@@ -41,7 +41,6 @@ services:
|
|||||||
- TRUSTED_PROXIES=${TRUSTED_PROXIES}
|
- TRUSTED_PROXIES=${TRUSTED_PROXIES}
|
||||||
- SURVEY_URL=${SURVEY_URL}
|
- SURVEY_URL=${SURVEY_URL}
|
||||||
- BUG_REPORT_URL=${BUG_REPORT_URL}
|
- BUG_REPORT_URL=${BUG_REPORT_URL}
|
||||||
- HOST_PWD=${PWD}
|
|
||||||
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
|
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
|
||||||
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
|
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
|
||||||
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
|
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
|
||||||
@@ -49,6 +48,8 @@ services:
|
|||||||
- TESTING=true
|
- TESTING=true
|
||||||
- TESTING_USERNAME=alex
|
- TESTING_USERNAME=alex
|
||||||
- TESTING_PASSWORD=Alex1234
|
- TESTING_PASSWORD=Alex1234
|
||||||
|
- HOST_PWD=${PWD}
|
||||||
|
- MOUNT_QUEST=${MOUNT_QUEST}
|
||||||
|
|
||||||
analytics:
|
analytics:
|
||||||
build:
|
build:
|
||||||
|
|||||||
@@ -25,7 +25,6 @@ const config = {
|
|||||||
db: get('MONGO_URL', 'mongodb://localhost:27017/odyssey-test'),
|
db: get('MONGO_URL', 'mongodb://localhost:27017/odyssey-test'),
|
||||||
secret: get('SECRET_KEY', ''),
|
secret: get('SECRET_KEY', ''),
|
||||||
isProduction: process.env.NODE_ENV === 'production',
|
isProduction: process.env.NODE_ENV === 'production',
|
||||||
hostPwd: get('HOST_PWD', ''),
|
|
||||||
containerExpiry: get('EXPIRY', 1000 * 60 * 60),
|
containerExpiry: get('EXPIRY', 1000 * 60 * 60),
|
||||||
sessionMaxAge: get('SESSION_MAX_AGE', 1000 * 60 * 60 * 24 * 7),
|
sessionMaxAge: get('SESSION_MAX_AGE', 1000 * 60 * 60 * 24 * 7),
|
||||||
google: {
|
google: {
|
||||||
@@ -45,6 +44,7 @@ const config = {
|
|||||||
defaultImage: get('QUEST_IMAGE', 'linuxodyssey/quest-base'),
|
defaultImage: get('QUEST_IMAGE', 'linuxodyssey/quest-base'),
|
||||||
imagePrefix: get('DOCKER_PREFIX', 'linuxodyssey/quest-'),
|
imagePrefix: get('DOCKER_PREFIX', 'linuxodyssey/quest-'),
|
||||||
mountQuest: get('MOUNT_QUEST', ''),
|
mountQuest: get('MOUNT_QUEST', ''),
|
||||||
|
hostPwd: get('HOST_PWD', ''),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,10 +23,12 @@ export function createContainer(name, questId) {
|
|||||||
name,
|
name,
|
||||||
Image: getQuestImage(questId),
|
Image: getQuestImage(questId),
|
||||||
}
|
}
|
||||||
if (!config.isProduction && config.hostPwd && config.mountQuest) {
|
const { hostPwd, mountQuest } = config.docker
|
||||||
option.HostConfig.Bind = [
|
if (!config.isProduction && hostPwd && mountQuest) {
|
||||||
`${config.hostPwd}/quests/${config.mountQuest}/home:/home/commander`,
|
console.log('Mounting quest folder', mountQuest)
|
||||||
`${config.hostPwd}/packages/container:/usr/local/lib/container`,
|
option.HostConfig.Binds = [
|
||||||
|
`${hostPwd}/quests/${mountQuest}/home:/home/commander`,
|
||||||
|
`${hostPwd}/packages/container:/usr/local/lib/container`,
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
return engine.createContainer(option)
|
return engine.createContainer(option)
|
||||||
|
|||||||
Reference in new issue
Block a user