收藏
回答

使用微信云托管部署egg.js总是失败,求教看看什么原因?

[2023-04-13 21:18:19] Step 2/7 : WORKDIR /usr/src/app/
[2023-04-13 21:18:19]  ---> Running in 3cd045fc7cf9
[2023-04-13 21:18:19] Removing intermediate container 3cd045fc7cf9
[2023-04-13 21:18:19]  ---> 306bc2126f39
[2023-04-13 21:18:19] Step 3/7 : COPY package*.json ./
[2023-04-13 21:18:20]  ---> be4a08961afc
[2023-04-13 21:18:20] Step 4/7 : RUN npm install --only=production
[2023-04-13 21:18:20]  ---> Running in 86214f46a757
[2023-04-13 21:18:20] npm WARN config only Use `--omit=dev` to omit dev dependencies from the install.
[2023-04-13 21:19:16] 
[2023-04-13 21:19:16] added 509 packages, and audited 510 packages in 54s
[2023-04-13 21:19:16] 
[2023-04-13 21:19:16] 28 packages are looking for funding
[2023-04-13 21:19:16]   run `npm fund` for details
[2023-04-13 21:19:16] 
[2023-04-13 21:19:16] 3 moderate severity vulnerabilities
[2023-04-13 21:19:16] 
[2023-04-13 21:19:16] To address all issues (including breaking changes), run:
[2023-04-13 21:19:16]   npm audit fix --force
[2023-04-13 21:19:16] 
[2023-04-13 21:19:16] Run `npm audit` for details.
[2023-04-13 21:19:16] npm notice 
[2023-04-13 21:19:16] npm notice New major version of npm available! 8.19.4 -> 9.6.4
[2023-04-13 21:19:16] npm notice Changelog: <https://github.com/npm/cli/releases/tag/v9.6.4>
[2023-04-13 21:19:16] npm notice Run `npm install -g npm@9.6.4` to update!
[2023-04-13 21:19:16] npm notice 
[2023-04-13 21:19:19] Removing intermediate container 86214f46a757
[2023-04-13 21:19:19]  ---> e277e782e07d
[2023-04-13 21:19:19] Step 5/7 : COPY . ./
[2023-04-13 21:19:19]  ---> 60c98b237b3b
[2023-04-13 21:19:19] Step 6/7 : EXPOSE 80
[2023-04-13 21:19:19]  ---> Running in 9d330c1de670
[2023-04-13 21:19:19] Removing intermediate container 9d330c1de670
[2023-04-13 21:19:19]  ---> 750c93117b62
[2023-04-13 21:19:19] Step 7/7 : CMD npm start
[2023-04-13 21:19:19]  ---> Running in 285f53ab0797
[2023-04-13 21:19:20] Removing intermediate container 285f53ab0797
[2023-04-13 21:19:20]  ---> c5aa4439aeac
[2023-04-13 21:19:20] Successfully built c5aa4439aeac
[2023-04-13 21:19:20] Successfully tagged ccr.ccs.tencentyun.com/tcb-******-ssfv/ca-qwjrwzsk_pldataeggjs:pldataeggjs-007-20230413211809
[2023-04-13 21:19:20] [Pipeline] }
[2023-04-13 21:19:20] [Pipeline] // stage
[2023-04-13 21:19:20] [Pipeline] stage
[2023-04-13 21:19:20] [Pipeline] { (推送 Docker 镜像到 TCR)
[2023-04-13 21:19:20] [Pipeline] sh
[2023-04-13 21:19:20] + docker push ccr.ccs.tencentyun.com/tcb-******-ssfv/ca-qwjrwzsk_pldataeggjs:pldataeggjs-007-20230413211809
[2023-04-13 21:19:20] The push refers to repository [ccr.ccs.tencentyun.com/tcb-******-ssfv/ca-qwjrwzsk_pldataeggjs]
[2023-04-13 21:19:20] ede65f54e703: Preparing
[2023-04-13 21:19:20] 1130b8d5d00f: Preparing
[2023-04-13 21:19:20] 31b4bfc32f31: Preparing
[2023-04-13 21:19:20] d7551259cd8f: Preparing
[2023-04-13 21:19:20] cafb113074aa: Preparing
[2023-04-13 21:19:20] 91c10016e43b: Preparing
[2023-04-13 21:19:20] 060963656c85: Preparing
[2023-04-13 21:19:20] e9c0f39d77af: Preparing
[2023-04-13 21:19:20] 61a5c84a1270: Preparing
[2023-04-13 21:19:20] 91c10016e43b: Layer already exists
[2023-04-13 21:19:20] e9c0f39d77af: Layer already exists
[2023-04-13 21:19:20] cafb113074aa: Layer already exists
[2023-04-13 21:19:20] 060963656c85: Layer already exists
[2023-04-13 21:19:20] 61a5c84a1270: Layer already exists
[2023-04-13 21:19:21] 31b4bfc32f31: Pushed
[2023-04-13 21:19:21] d7551259cd8f: Pushed
[2023-04-13 21:19:22] ede65f54e703: Pushed
[2023-04-13 21:20:18] 1130b8d5d00f: Pushed
[2023-04-13 21:20:20] pldataeggjs-007-20230413211809: digest: sha256:729c6cc824986448cf96b39f2aefa714e3f38219954a7327e5581dcd5f632d6d size: 2205
[2023-04-13 21:20:20] [Pipeline] }
[2023-04-13 21:20:20] [Pipeline] // stage
[2023-04-13 21:20:20] [Pipeline] }
[2023-04-13 21:20:20] [Pipeline] // node
[2023-04-13 21:20:20] [Pipeline] End of Pipeline
[2023-04-13 21:20:20] Finished: SUCCESS
***
-----------构建pldataeggjs-007-----------
2023-04-13 21:18:10 create_build_image : succ, 
2023-04-13 21:20:25 check_build_image : succ, , 
-----------服务pldataeggjs部署pldataeggjs-007-----------
2023-04-13 21:20:27 create_eks_virtual_service : succ, 
2023-04-13 21:20:27 check_eks_virtual_service : process, DescribeVersion_user_error_Liveness probe failed: dial tcp 10.15.24.130:80: connect: connection refused, [service]:[Readiness probe failed: dial tcp 10.15.24.130:80: connect: connection refused,Liveness probe failed: dial tcp 10.15.24.130:80: connect: connection refused,]


wx3c8406171c9106a1 pldataprod-1ghwo42v0d4b4041 tid=211311 rid=multi_tenant_1pmwpteiiLC8fd pldataeggjs bid=31295261 pldataeggjs-007

FROM node:16-slim
WORKDIR /usr/src/app/
COPY package*.json ./
RUN npm install --only=production
COPY . ./
EXPOSE 80
CMD npm start


/* eslint valid-jsdoc: "off" */


'use strict';


/**
 * @param {Egg.EggAppInfo} appInfo app info
 */
module.exports = appInfo => {
    /**
     * built-in config
     * @type {Egg.EggAppConfig}
     **/
    const config = exports = {};


    // use for cookie sign key, should change to your own and keep security
    config.keys = appInfo.name + '_1677934195632_7969';


    // add your middleware config here
    config.middleware = [];


    config.cors = {
        origin: '*',
        allowMethods: 'GET, PUT,  POST, DELETE, PATCH',
    };


    config.security = {
        csrf: {
            enable: false
        },
    };


    config.validate = {


    };


    config.sequelize = {
        dialect: '',
        host: '',
        port: 3306,
        database: '',
        username: '',
        password: '',
        timezone: '+08:00', // 时区改成东8区
        define: {
            freezeTableName: true, // 禁止转换为负数
            underscored: true, //禁止转换为驼峰
        }
    };


    config.jwt = {
        secret: '',
        expiresIn: '24h',
    };


    // 密码加密
    config.bcrypt = {
        saltRounds: 10,
    };


    config.cluster = {
        listen: {
            path: '',
            port: 80,
            hostname: '127.0.0.1'
        }
    }


    // add your user config here
    const userConfig = {
        // myAppName: 'egg',
    };


    return {
        ...config,
        ...userConfig,
    };
};




快被郁闷死了,求指教!

回答关注问题邀请回答
收藏

2 个回答

  • alive
    alive
    2023-04-20

    文章还在审核,急需教程啊大佬

    2023-04-20
    有用
    回复
  • 觀·自在
    觀·自在
    2023-04-13

    问题已解决,遇到问题的小伙伴,可以看我发的文章《4步成功在微信云托管成功部署 egg.js 项目

    2023-04-13
    有用
    回复 2
    • a互联未来
      a互联未来
      2023-04-14
      eggjs 是前后分离?
      2023-04-14
      回复
    • kk
      kk
      2023-04-22
      能直接在这里回复吗?我看你的文章到现在都没有审核通过。
      你是使用docker部署的吗?
      2023-04-22
      回复
登录 后发表内容
问题标签