refactor: 端口改为内部映射,通过 Nginx 反向代理访问
- docker-compose.test.yml: API 和 MongoDB 端口改为 expose(仅容器内部可见) - webhook-server.js: 端口改为 19001,绑定 127.0.0.1(仅本机访问) - 新增 deploy/nginx-test.conf Nginx 反向代理配置 - API: miniapp-api-test.dxz99wyr.cn → miniapp-api_test:3001 - Webhook: miniapp-api-test-webhook.dxz99wyr.cn/webhook → 127.0.0.1:19001 - 更新 setup.sh 和 README.md 文档
This commit is contained in:
@@ -3,7 +3,7 @@ const { exec } = require('child_process');
|
||||
const path = require('path');
|
||||
const crypto = require('crypto');
|
||||
|
||||
const PORT = 9001;
|
||||
const PORT = 19001;
|
||||
const DEPLOY_DIR = '/opt/miniapp-api_test';
|
||||
const COMPOSE_FILE = 'docker-compose.test.yml';
|
||||
|
||||
@@ -98,8 +98,9 @@ const server = http.createServer(async (req, res) => {
|
||||
});
|
||||
});
|
||||
|
||||
server.listen(PORT, '0.0.0.0', () => {
|
||||
server.listen(PORT, '127.0.0.1', () => {
|
||||
console.log(`Webhook 服务器已启动, 监听端口 ${PORT}`);
|
||||
console.log(`部署目录: ${DEPLOY_DIR}`);
|
||||
console.log(`接收地址: http://your-server-ip:${PORT}/webhook`);
|
||||
console.log(`接收地址: http://127.0.0.1:${PORT}/webhook`);
|
||||
console.log(`Nginx 代理地址: http://your-server-ip/webhook`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user