able to run server without in docker

This commit is contained in:
wancat committed 2024-02-05 12:41:07 +08:00
1 parent 19cd66475c
commit ec4e97a7d6
4 files changed
+4 -8

No files matched your search

+2 -1
View File
@@ -44,7 +44,7 @@ const config = {
bugReportUrl: getUrl('BUG_REPORT_URL', ''),
docker: {
network: get('DOCKER_NETWORK', 'linux-odyssey-players'),
network: get('DOCKER_NETWORK', 'host'),
defaultImage: get('QUEST_IMAGE', 'linuxodyssey/quest-base'),
imagePrefix: get('DOCKER_PREFIX', 'linuxodyssey/quest-'),
mountQuest: get('MOUNT_QUEST', ''),
@@ -57,6 +57,7 @@ const config = {
}
config.baseUrl = get('BASE_URL', `http://${config.host}:${config.port}`)
config.backendUrl = get('BACKEND_URL', config.baseUrl)
config.testing = {
enabled: !config.isProduction && process.env.TESTING === 'true',
username: get('TESTING_USERNAME', ''),
+1 -3
View File
@@ -16,8 +16,6 @@ const containerOptions = {
},
}
// const network = engine.getNetwork(config.dockerNetwork)
export function createContainer(name, questId) {
const option = {
...containerOptions,
@@ -56,7 +54,7 @@ export async function attachContainer(container, { token }) {
Tty: true,
Env: [
`TOKEN=${token}`,
`API_ENDPOINT=http://backend:3000`,
`API_ENDPOINT=${config.backendUrl}`,
'ZDOTDIR=/etc/zsh',
],
})
-2
View File
@@ -41,7 +41,6 @@ async function loadGlobalExceptions() {
export async function loadAndUpdateQuests() {
await Quest.deleteMany({})
const { exceptions } = await loadGlobalExceptions()
console.log(exceptions)
return mapQuests(async (id, questPath) => {
const files = await fs.readdir(questPath)
if (!files.includes('game.yml')) {
@@ -64,7 +63,6 @@ export async function loadAndUpdateQuests() {
quest.exceptions.push(...exceptions)
await quest.save()
} catch (error) {
console.error(error)
logger.error(`Error parsing quest`, { id, error })
throw new QuestValidationError(`Error parsing quest`, id, error)
}