feat: update docker config

This commit is contained in:
chenos 2024-03-28 10:44:55 +08:00
parent 2468caeeb9
commit f2d4188ccf
6 changed files with 37 additions and 0 deletions

View File

@ -17,6 +17,7 @@ services:
- DB_USER=nocobase - DB_USER=nocobase
- DB_PASSWORD=nocobase - DB_PASSWORD=nocobase
- DB_TIMEZONE=+08:00 - DB_TIMEZONE=+08:00
- DB_UNDERSCORED=true
volumes: volumes:
- ./storage:/app/nocobase/storage - ./storage:/app/nocobase/storage
ports: ports:
@ -29,5 +30,7 @@ services:
MYSQL_PASSWORD: nocobase MYSQL_PASSWORD: nocobase
MYSQL_ROOT_PASSWORD: nocobase MYSQL_ROOT_PASSWORD: nocobase
restart: always restart: always
volumes:
- ./storage/db/mariadb:/var/lib/mysql
networks: networks:
- nocobase - nocobase

View File

@ -29,5 +29,7 @@ services:
MYSQL_PASSWORD: nocobase MYSQL_PASSWORD: nocobase
MYSQL_ROOT_PASSWORD: nocobase MYSQL_ROOT_PASSWORD: nocobase
restart: always restart: always
volumes:
- ./storage/db/mysql:/var/lib/mysql
networks: networks:
- nocobase - nocobase

View File

@ -28,5 +28,7 @@ services:
POSTGRES_USER: nocobase POSTGRES_USER: nocobase
POSTGRES_DB: nocobase POSTGRES_DB: nocobase
POSTGRES_PASSWORD: nocobase POSTGRES_PASSWORD: nocobase
volumes:
- ./storage/db/postgres:/var/lib/postgresql/data
networks: networks:
- nocobase - nocobase

View File

@ -18,6 +18,7 @@
"scripts": { "scripts": {
"nocobase": "nocobase", "nocobase": "nocobase",
"pm": "nocobase pm", "pm": "nocobase pm",
"pm2": "nocobase pm2",
"dev": "nocobase dev", "dev": "nocobase dev",
"dev-server": "nocobase dev --server", "dev-server": "nocobase dev --server",
"start": "nocobase start", "start": "nocobase start",

View File

@ -16,6 +16,7 @@ module.exports = (cli) => {
require('./e2e')(cli); require('./e2e')(cli);
require('./clean')(cli); require('./clean')(cli);
require('./doc')(cli); require('./doc')(cli);
require('./pm2')(cli);
require('./test')(cli); require('./test')(cli);
require('./umi')(cli); require('./umi')(cli);
require('./upgrade')(cli); require('./upgrade')(cli);

View File

@ -0,0 +1,28 @@
const chalk = require('chalk');
const { Command } = require('commander');
const { run, isDev } = require('../util');
/**
*
* @param {Command} cli
*/
module.exports = (cli) => {
cli
.command('pm2')
.allowUnknownOption()
.action(() => {
run('pm2', process.argv.slice(3));
});
cli
.command('pm2-restart')
.allowUnknownOption()
.action(() => {
run('pm2', ['restart', 'all']);
});
cli
.command('pm2-stop')
.allowUnknownOption()
.action(() => {
run('pm2', ['stop', 'all']);
});
};