fix: Update ports to avoid conflicts with existing Docker projects
- Change Gitea port from 3000 to 3001 - Change API port from 8080 to 8082 - Change Nginx port from 80 to 8083 - Add docker-compose.override.yml for local development - Add deployment guide for existing servers
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
# Docker Compose Override for Development/Local Testing
|
||||
# Usage: docker compose -f docker-compose.yml -f docker-compose.override.yml up
|
||||
|
||||
services:
|
||||
# Use standard ports for local development
|
||||
gitea:
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "222:22"
|
||||
environment:
|
||||
- GITEA__server__ROOT_URL=http://localhost:3000
|
||||
- GITEA__server__SSH_PORT=222
|
||||
|
||||
postgres:
|
||||
ports:
|
||||
- "5432:5432"
|
||||
|
||||
nanaxe-api:
|
||||
ports:
|
||||
- "8080:8080"
|
||||
environment:
|
||||
- NODE_ENV=development
|
||||
|
||||
nginx:
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
|
||||
webdav:
|
||||
ports:
|
||||
- "8081:80"
|
||||
@@ -1,5 +1,8 @@
|
||||
version: '3.8'
|
||||
|
||||
# Nanaxe Server - Mindmap Synchronization
|
||||
# Run alongside other Docker projects by changing ports
|
||||
|
||||
services:
|
||||
# Gitea - Self-hosted Git server для хранения markdown-файлов
|
||||
gitea:
|
||||
@@ -14,9 +17,9 @@ services:
|
||||
- GITEA__database__USER=gitea
|
||||
- GITEA__database__PASSWD=gitea_password
|
||||
- GITEA__server__DOMAIN=${GITEA_DOMAIN:-localhost}
|
||||
- GITEA__server__ROOT_URL=http://${GITEA_DOMAIN:-localhost}:3000
|
||||
- GITEA__server__ROOT_URL=http://${GITEA_DOMAIN:-localhost}:3001
|
||||
- GITEA__server__SSH_DOMAIN=${GITEA_DOMAIN:-localhost}
|
||||
- GITEA__server__SSH_PORT=222
|
||||
- GITEA__server__SSH_PORT=2221
|
||||
- GITEA__server__SSH_LISTEN_PORT=22
|
||||
- GITEA__security__INSTALL_LOCK=true
|
||||
- GITEA__service__DISABLE_REGISTRATION=false
|
||||
@@ -29,8 +32,8 @@ services:
|
||||
- /etc/timezone:/etc/timezone:ro
|
||||
- /etc/localtime:/etc/localtime:ro
|
||||
ports:
|
||||
- "3000:3000"
|
||||
- "222:22"
|
||||
- "3001:3000" # Changed from 3000 to avoid conflicts
|
||||
- "2221:22" # Changed from 222 to avoid conflicts
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
@@ -38,6 +41,8 @@ services:
|
||||
postgres:
|
||||
image: postgres:16-alpine
|
||||
container_name: nanaxe-postgres
|
||||
ports:
|
||||
- "5433:5432" # Expose on different port
|
||||
environment:
|
||||
- POSTGRES_USER=gitea
|
||||
- POSTGRES_PASSWORD=gitea_password
|
||||
@@ -68,7 +73,7 @@ services:
|
||||
- mindmap-data:/app/mindmaps
|
||||
- ./api/logs:/app/logs
|
||||
ports:
|
||||
- "8080:8080"
|
||||
- "8082:8080" # Changed from 8080 to avoid conflicts
|
||||
depends_on:
|
||||
- gitea
|
||||
- postgres
|
||||
@@ -84,8 +89,8 @@ services:
|
||||
- ./nginx/nginx.conf:/etc/nginx/nginx.conf:ro
|
||||
- ./nginx/html:/usr/share/nginx/html:ro
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
- "8083:80" # Changed from 80 to avoid conflicts
|
||||
- "8444:443" # Changed from 443 to avoid conflicts
|
||||
depends_on:
|
||||
- gitea
|
||||
- nanaxe-api
|
||||
@@ -104,7 +109,7 @@ services:
|
||||
- USERNAME=${WEBDAV_USER:-admin}
|
||||
- PASSWORD=${WEBDAV_PASSWORD:-admin}
|
||||
ports:
|
||||
- "8081:80"
|
||||
- "8084:80" # Changed from 8081 to avoid conflicts
|
||||
|
||||
networks:
|
||||
nanaxe-network:
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
module.exports = {
|
||||
apps: [{
|
||||
name: 'nanaxe-api',
|
||||
script: './api/src/index.js',
|
||||
instances: 1,
|
||||
exec_mode: 'fork',
|
||||
env: {
|
||||
NODE_ENV: 'production',
|
||||
PORT: 3001
|
||||
},
|
||||
error_file: './logs/err.log',
|
||||
out_file: './logs/out.log',
|
||||
log_file: './logs/combined.log',
|
||||
time: true,
|
||||
max_memory_restart: '256M',
|
||||
restart_delay: 3000,
|
||||
max_restarts: 5,
|
||||
min_uptime: '10s',
|
||||
watch: false,
|
||||
ignore_watch: ['node_modules', 'logs', 'data'],
|
||||
merge_logs: true,
|
||||
log_type: 'json',
|
||||
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
|
||||
// Auto-restart on failure
|
||||
autorestart: true,
|
||||
// Don't restart if crashing too fast
|
||||
exp_backoff_restart_delay: 100
|
||||
}]
|
||||
};
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "nanaxe-api-server",
|
||||
"version": "1.0.0",
|
||||
"description": "API server for Nanaxe CRM mindmap synchronization - FastPanel compatible",
|
||||
"main": "api/src/index.js",
|
||||
"scripts": {
|
||||
"start": "node api/src/index.js",
|
||||
"dev": "nodemon api/src/index.js",
|
||||
"pm2:start": "pm2 start ecosystem.config.js",
|
||||
"pm2:stop": "pm2 stop ecosystem.config.js",
|
||||
"pm2:restart": "pm2 restart ecosystem.config.js",
|
||||
"pm2:logs": "pm2 logs nanaxe-api",
|
||||
"install:deps": "npm ci --production"
|
||||
},
|
||||
"dependencies": {
|
||||
"express": "^4.18.2",
|
||||
"cors": "^2.8.5",
|
||||
"helmet": "^7.1.0",
|
||||
"morgan": "^1.10.0",
|
||||
"jsonwebtoken": "^9.0.2",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"axios": "^1.6.2",
|
||||
"simple-git": "^3.21.0",
|
||||
"fs-extra": "^11.2.0",
|
||||
"uuid": "^9.0.1",
|
||||
"dotenv": "^16.3.1",
|
||||
"express-rate-limit": "^7.1.5",
|
||||
"multer": "^1.4.5-lts.1",
|
||||
"yaml": "^2.3.4",
|
||||
"sqlite3": "^5.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"nodemon": "^3.0.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=18.0.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user