config.prod.ts 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. import { MidwayConfig } from '@midwayjs/core';
  2. const ip = 'host.docker.internal';
  3. const redisHost = ip;
  4. const redisPwd = '123456';
  5. const redisDB = 1;
  6. const projectDB = 'vue3js-template-test';
  7. const recordDB = 'vue3js-template-test-record'
  8. const loginSign = 'information_platform';
  9. export default {
  10. // use for cookie sign key, should change to your own and keep security
  11. keys: '1697684406848_4978',
  12. loginSign,
  13. koa: {
  14. port: 9700,
  15. globalPrefix: '/cxyy/api',
  16. queryParseMode: 'extended',
  17. },
  18. elasticsearch: {
  19. node: 'http://localhost:9200',
  20. auth: {
  21. username: 'elastic',
  22. password: 'NAjqFz_7tS2DkdpU7p*x',
  23. },
  24. },
  25. dbName: projectDB,
  26. mongoose: {
  27. dataSource: {
  28. default: {
  29. uri: `mongodb://${ip}:27017/${projectDB}`,
  30. options: {
  31. user: 'admin',
  32. pass: 'admin',
  33. authSource: 'admin',
  34. useNewUrlParser: true,
  35. },
  36. entities: ['./entity'],
  37. },
  38. record:{
  39. uri: `mongodb://${ip}:27017/${recordDB}`,
  40. options: {
  41. user: 'admin',
  42. pass: 'admin',
  43. authSource: 'admin',
  44. useNewUrlParser: true,
  45. },
  46. entities: ['./entityRecord'],
  47. }
  48. },
  49. },
  50. redis: {
  51. client: {
  52. port: 6379, // Redis port
  53. host: redisHost, // Redis host
  54. password: redisPwd,
  55. db: redisDB,
  56. },
  57. },
  58. bull: {
  59. // 默认的队列配置
  60. defaultQueueOptions: {
  61. redis: {
  62. port: 6379,
  63. host: redisHost,
  64. password: redisPwd,
  65. db: redisDB,
  66. },
  67. },
  68. },
  69. upload: {
  70. whitelist: null,
  71. },
  72. } as MidwayConfig;