aggiunto server sftp con variabile d'ambiente FTP_MODE

This commit is contained in:
2025-11-02 16:19:24 +01:00
parent e0f95919be
commit 10d58a3124
6 changed files with 570 additions and 20 deletions

View File

@@ -1,15 +1,21 @@
version: '3.8'
services:
# ============================================================================
# FTP Server (Traditional FTP)
# ============================================================================
ftp-server:
build: .
container_name: ase-ftp-server
ports:
- "2121:2121" # FTP control port
- "60000-60099:60000-60099" # FTP passive ports range
- "40000-40449:40000-40449" # FTP passive ports range
environment:
# Server Mode
FTP_MODE: "ftp" # Mode: ftp or sftp
# FTP Configuration
FTP_PASSIVE_PORTS: "60000" # Prima porta del range passivo
FTP_PASSIVE_PORTS: "40000" # Prima porta del range passivo
FTP_EXTERNAL_IP: "192.168.1.100" # IP esterno/VIP da pubblicizzare ai client
# Database Configuration
@@ -22,7 +28,7 @@ services:
# Logging (opzionale)
LOG_LEVEL: "INFO"
volumes:
- ./logs:/app/logs
- ./logs/ftp:/app/logs
- ./data:/app/data
depends_on:
- mysql-server
@@ -30,15 +36,49 @@ services:
networks:
- ase-network
# Esempio di setup HA con più istanze FTP
# ============================================================================
# SFTP Server (SSH File Transfer Protocol)
# ============================================================================
sftp-server:
build: .
container_name: ase-sftp-server
ports:
- "2222:22" # SFTP port (SSH)
environment:
# Server Mode
FTP_MODE: "sftp" # Mode: ftp or sftp
# Database Configuration
DB_HOST: "mysql-server"
DB_PORT: "3306"
DB_USER: "ase_user"
DB_PASSWORD: "your_secure_password"
DB_NAME: "ase_lar"
# Logging (opzionale)
LOG_LEVEL: "INFO"
volumes:
- ./logs/sftp:/app/logs
- ./data:/app/data
- ./ssh_host_key:/app/ssh_host_key:ro # SSH host key (generate with: ssh-keygen -t rsa -f ssh_host_key)
depends_on:
- mysql-server
restart: unless-stopped
networks:
- ase-network
# ============================================================================
# Esempio: Setup HA con più istanze FTP (stesso VIP)
# ============================================================================
ftp-server-2:
build: .
container_name: ase-ftp-server-2
ports:
- "2122:2121" # Diversa porta di controllo per seconda istanza
- "61000-61099:60000-60099" # Diverso range passivo
- "41000-41449:40000-40449" # Diverso range passivo sull'host
environment:
FTP_PASSIVE_PORTS: "60000" # Stessa config, ma mappata su porte diverse dell'host
FTP_MODE: "ftp"
FTP_PASSIVE_PORTS: "40000" # Stessa config interna
FTP_EXTERNAL_IP: "192.168.1.100" # Stesso VIP condiviso
DB_HOST: "mysql-server"
DB_PORT: "3306"
@@ -47,7 +87,7 @@ services:
DB_NAME: "ase_lar"
LOG_LEVEL: "INFO"
volumes:
- ./logs2:/app/logs
- ./logs/ftp2:/app/logs
- ./data:/app/data
depends_on:
- mysql-server