mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
fix: update quest image name
This commit is contained in:
1 parent
aed66a4fe5
commit
f9e0fade3b
8 files changed
+26
-16
No files matched your search
@@ -31,6 +31,6 @@ jobs:
|
||||
build-base:
|
||||
uses: ./.github/workflows/build-docker-image.yml
|
||||
with:
|
||||
imageName: 'linuxodyssey/base'
|
||||
imageName: 'linuxodyssey/quest-base'
|
||||
dockerfilePath: './quests/Dockerfile'
|
||||
secrets: inherit
|
||||
@@ -77,7 +77,7 @@ services:
|
||||
- BUG_REPORT_URL=${BUG_REPORT_URL}
|
||||
|
||||
base:
|
||||
image: linuxodyssey/base
|
||||
image: linuxodyssey/quest-base
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./quests/Dockerfile
|
||||
|
||||
@@ -16,7 +16,7 @@ services:
|
||||
- app-test
|
||||
|
||||
app-test:
|
||||
image: lancatlin/linux-odyssey:app
|
||||
image: linuxodyssey/app
|
||||
build:
|
||||
context: .
|
||||
dockerfile: app/Dockerfile
|
||||
@@ -29,7 +29,7 @@ services:
|
||||
- backend
|
||||
|
||||
backend:
|
||||
image: lancatlin/linux-odyssey:backend
|
||||
image: linuxodyssey/backend
|
||||
build:
|
||||
context: .
|
||||
dockerfile: server/Dockerfile
|
||||
@@ -73,7 +73,7 @@ services:
|
||||
- 27017:27017
|
||||
|
||||
base:
|
||||
image: lancatlin/linux-odyssey:base
|
||||
image: linuxodyssey/quest-base
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./quests/Dockerfile
|
||||
|
||||
+4
-1
@@ -14,6 +14,7 @@ services:
|
||||
volumes:
|
||||
- ./app:/app/app
|
||||
- ./packages:/app/packages
|
||||
|
||||
backend:
|
||||
depends_on:
|
||||
- db
|
||||
@@ -62,6 +63,8 @@ services:
|
||||
- '3001:3001'
|
||||
environment:
|
||||
- MONGO_URL=mongodb://db:27017/odyssey-test
|
||||
- USERNAME=user
|
||||
- PASSWORD=user
|
||||
volumes:
|
||||
- ./packages/analytics:/app/packages/analytics
|
||||
- ./packages/models:/app/packages/models
|
||||
@@ -85,7 +88,7 @@ services:
|
||||
- SWAGGER_FILE=/tmp/swagger.yaml
|
||||
|
||||
base:
|
||||
image: lancatlin/linux-odyssey:base
|
||||
image: linuxodyssey/quest-base
|
||||
build:
|
||||
context: .
|
||||
dockerfile: ./quests/Dockerfile
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM lancatlin/linux-odyssey:base
|
||||
FROM linuxodyssey/quest-base
|
||||
|
||||
COPY home ${HOME}
|
||||
@@ -1,3 +1,3 @@
|
||||
FROM lancatlin/linux-odyssey:base
|
||||
FROM linuxodyssey/quest-base
|
||||
|
||||
COPY home ${HOME}
|
||||
+10
-3
@@ -24,7 +24,6 @@ const config = {
|
||||
port: get('PORT', 3000),
|
||||
db: get('MONGO_URL', 'mongodb://localhost:27017/odyssey-test'),
|
||||
secret: get('SECRET_KEY', ''),
|
||||
dockerNetwork: get('DOCKER_NETWORK', 'linux-odyssey-players'),
|
||||
isProduction: process.env.NODE_ENV === 'production',
|
||||
hostPwd: get('HOST_PWD', ''),
|
||||
containerExpiry: get('EXPIRY', 1000 * 60 * 60),
|
||||
@@ -40,9 +39,13 @@ const config = {
|
||||
trustedProxies: getTrustProxies('TRUSTED_PROXIES'),
|
||||
surveyUrl: getUrl('SURVEY_URL', ''),
|
||||
bugReportUrl: getUrl('BUG_REPORT_URL', ''),
|
||||
dockerImage: get('DOCKER_IMAGE', 'lancatlin/linux-odyssey'),
|
||||
|
||||
mountQuest: get('MOUNT_QUEST', ''),
|
||||
docker: {
|
||||
network: get('DOCKER_NETWORK', 'linux-odyssey-players'),
|
||||
defaultImage: get('QUEST_IMAGE', 'linuxodyssey/quest-base'),
|
||||
imagePrefix: get('DOCKER_PREFIX', 'linuxodyssey/quest-'),
|
||||
mountQuest: get('MOUNT_QUEST', ''),
|
||||
},
|
||||
}
|
||||
|
||||
config.baseUrl = get('BASE_URL', `http://${config.host}:${config.port}`)
|
||||
@@ -52,4 +55,8 @@ config.testing = {
|
||||
password: get('TESTING_PASSWORD', ''),
|
||||
}
|
||||
|
||||
export function getQuestImage(id) {
|
||||
return `${config.docker.imagePrefix}${id}`
|
||||
}
|
||||
|
||||
export default config
|
||||
@@ -1,5 +1,5 @@
|
||||
import Docker from 'dockerode'
|
||||
import config from '../config.js'
|
||||
import config, { getQuestImage } from '../config.js'
|
||||
|
||||
const engine = new Docker()
|
||||
|
||||
@@ -11,17 +11,17 @@ const containerOptions = {
|
||||
OpenStdin: true,
|
||||
StdinOnce: false,
|
||||
HostConfig: {
|
||||
NetworkMode: config.dockerNetwork,
|
||||
NetworkMode: config.docker.network,
|
||||
},
|
||||
}
|
||||
|
||||
// const network = engine.getNetwork(config.dockerNetwork)
|
||||
|
||||
export function createContainer(name, tag) {
|
||||
export function createContainer(name, questId) {
|
||||
const option = {
|
||||
...containerOptions,
|
||||
name,
|
||||
Image: `${config.dockerImage}:${tag}`,
|
||||
Image: getQuestImage(questId),
|
||||
}
|
||||
if (!config.isProduction && config.hostPwd && config.mountQuest) {
|
||||
option.HostConfig.Bind = [
|
||||
@@ -87,7 +87,7 @@ export function buildQuestImage(questPath, questId) {
|
||||
src: ['Dockerfile', 'home'],
|
||||
},
|
||||
{
|
||||
t: `${config.dockerImage}:${questId}`,
|
||||
t: getQuestImage(questId),
|
||||
networkmode: 'none',
|
||||
memory: 10 * 1e6,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user