mirror of https://github.com/certd/certd
chore: node 16
parent
71a289b009
commit
7b9d70e093
|
@ -1,10 +1,11 @@
|
||||||
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/node:16-alpine
|
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/node:16-alpine
|
||||||
|
EXPOSE 7001
|
||||||
|
ENV NODE_ENV production
|
||||||
|
WORKDIR /app/
|
||||||
#RUN npm install cross-env -g --registry=https://registry.npmmirror.com
|
#RUN npm install cross-env -g --registry=https://registry.npmmirror.com
|
||||||
#RUN npm install pm2 -g --registry=https://registry.npmmirror.com
|
#RUN npm install pm2 -g --registry=https://registry.npmmirror.com
|
||||||
#RUN pm2 install pm2-logrotate
|
#RUN pm2 install pm2-logrotate
|
||||||
ADD ./workspace/certd-server/ /app/
|
ADD ./workspace/certd-server/ /app/
|
||||||
WORKDIR /app/
|
|
||||||
ENV NODE_ENV production
|
|
||||||
RUN yarn install -P --registry=https://registry.npmmirror.com
|
RUN yarn install -P --registry=https://registry.npmmirror.com
|
||||||
#CMD ["pm2-runtime", "start", "./bootstrap.js","--name", "certd","-i","1"]
|
#CMD ["pm2-runtime", "start", "./bootstrap.js","--name", "certd","-i","1"]
|
||||||
CMD ["npm", "run","start"]
|
CMD ["npm", "run","start"]
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
|
FROM registry.cn-shenzhen.aliyuncs.com/handsfree/certd:latest
|
||||||
#RUN npm install pm2 -g --registry=https://registry.npmmirror.com
|
|
||||||
EXPOSE 7001
|
EXPOSE 7001
|
||||||
#CMD ["pm2-runtime", "start", "./bootstrap.js","--name", "certd","-i","1","--", "-p", "7001"]
|
RUN npm install pm2 -g --registry=https://registry.npmmirror.com
|
||||||
CMD ["node", "./bootstrap.js"]
|
CMD ["pm2-runtime", "start", "./bootstrap.js","--name", "certd","-i","1","--", "-p", "7001"]
|
||||||
|
#CMD ["npm","run", "start"]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import { PreviewMiddleware } from './middleware/preview';
|
||||||
import { AuthorityMiddleware } from './middleware/authority';
|
import { AuthorityMiddleware } from './middleware/authority';
|
||||||
import * as staticFile from '@midwayjs/static-file';
|
import * as staticFile from '@midwayjs/static-file';
|
||||||
import * as cron from './plugins/cron';
|
import * as cron from './plugins/cron';
|
||||||
|
import { logger } from './utils/logger';
|
||||||
|
|
||||||
@Configuration({
|
@Configuration({
|
||||||
imports: [koa, orm, cache, flyway, validateComp, cron, staticFile],
|
imports: [koa, orm, cache, flyway, validateComp, cron, staticFile],
|
||||||
|
@ -46,6 +47,11 @@ export class ContainerLifeCycle {
|
||||||
//this.app.use(bodyParser());
|
//this.app.use(bodyParser());
|
||||||
//请求日志打印
|
//请求日志打印
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
console.log('heart beat ');
|
||||||
|
logger.info('heart beat');
|
||||||
|
}, 5000);
|
||||||
|
|
||||||
this.app.useMiddleware([
|
this.app.useMiddleware([
|
||||||
ReportMiddleware,
|
ReportMiddleware,
|
||||||
//统一异常处理
|
//统一异常处理
|
||||||
|
|
Loading…
Reference in New Issue