mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19: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}
|
||||
- SURVEY_URL=${SURVEY_URL}
|
||||
- BUG_REPORT_URL=${BUG_REPORT_URL}
|
||||
- HOST_PWD=${PWD}
|
||||
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
|
||||
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET}
|
||||
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
|
||||
@@ -49,6 +48,8 @@ services:
|
||||
- TESTING=true
|
||||
- TESTING_USERNAME=alex
|
||||
- TESTING_PASSWORD=Alex1234
|
||||
- HOST_PWD=${PWD}
|
||||
- MOUNT_QUEST=${MOUNT_QUEST}
|
||||
|
||||
analytics:
|
||||
build:
|
||||
|
||||
@@ -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', ''),
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user