Skip to content

Commit

Permalink
feat(system-server): add app service image config;
Browse files Browse the repository at this point in the history
  • Loading branch information
maslow committed Sep 6, 2021
1 parent 308ad8a commit 0f770ab
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/system-server/.env.template
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
SYS_DB_URI=mongodb://laf-sys:laf-sys@mongodb-server:27017/?authSource=laf-sys&replicaSet=laf&writeConcern=majority
APP_DB_URI=mongodb://root:your_root_passwd@mongodb-server:27017/?authSource=admin&replicaSet=laf&writeConcern=majority
SYS_SERVER_SECRET_SALT=abcdefg1234567!@#$%^&sadfqwef&*^*#!@^
SHARED_NETWORK=laf_shared_network
SHARED_NETWORK=laf_shared_network
APP_SERVICE_IMAGE=lessx/laf-app-server:latest
7 changes: 7 additions & 0 deletions packages/system-server/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,11 @@ export default class Config {
static get SHARED_NETWORK(): string {
return process.env.SHARED_NETWORK ?? 'laf_shared_network'
}

/**
* the app service image name
*/
static get APP_SERVICE_IMAGE(): string {
return process.env.APP_SERVICE_IMAGE
}
}
4 changes: 2 additions & 2 deletions packages/system-server/src/lib/service-driver/container.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export class DockerContainerServiceDriver {
const uri = getApplicationDbUri(app)

const container = await this.docker.createContainer({
Image: 'lessx/laf-app-server:latest',
Cmd: ['npm', 'run', 'init-start'],
Image: Config.APP_SERVICE_IMAGE,
Cmd: ['node', './dist/start.js'],
name: `app_${app.appid}`,
Env: [
`DB=${app.config.db_name}`,
Expand Down

0 comments on commit 0f770ab

Please sign in to comment.