diff --git a/vm1/docker-compose.yml b/vm1/docker-compose.yml index ea91adb..0a9a862 100644 --- a/vm1/docker-compose.yml +++ b/vm1/docker-compose.yml @@ -8,8 +8,11 @@ services: MYSQL_DATABASE: ${MYSQL_DATABASE:-ase_lar} MYSQL_USER: ${MYSQL_USER:-ase_lar} MYSQL_PASSWORD: ${MYSQL_PASSWORD:-ase_lar} + TZ: Europe/Rome volumes: - mysql_data:/var/lib/mysql + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro networks: - app-network ports: @@ -30,8 +33,11 @@ services: environment: DB_HOST: ${VIP:-192.168.1.210} ORCHESTRATOR_ID: 1 + TZ: Europe/Rome volumes: - app-logs:/app/logs + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro networks: - app-network labels: @@ -44,8 +50,11 @@ services: environment: DB_HOST: ${VIP:-192.168.1.210} ORCHESTRATOR_ID: 2 + TZ: Europe/Rome volumes: - app-logs:/app/logs + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro networks: - app-network labels: @@ -58,8 +67,11 @@ services: environment: DB_HOST: ${VIP:-192.168.1.210} ORCHESTRATOR_ID: 3 + TZ: Europe/Rome volumes: - app-logs:/app/logs + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro networks: - app-network labels: @@ -72,12 +84,40 @@ services: environment: DB_HOST: ${VIP:-192.168.1.210} FTP_INSTANCE_ID: 1 + TZ: Europe/Rome + FTP_PASSIVE_PORT: "40000" + FTP_EXTERNAL_IP: ${VIP:-192.168.1.210} volumes: - app-logs:/app/logs + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro networks: - app-network expose: - "21" + - "40000-40249" + labels: + logging: "promtail" + ftp-server-1b: + build: . + container_name: ftp-server-1b + restart: unless-stopped + command: ["python", "-m", "src.ftp_csv_receiver"] + environment: + DB_HOST: ${VIP:-192.168.1.210} + FTP_INSTANCE_ID: 7 + TZ: Europe/Rome + FTP_PASSIVE_PORT: "40250" + FTP_EXTERNAL_IP: ${VIP:-192.168.1.210} + volumes: + - app-logs:/app/logs + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + networks: + - app-network + expose: + - "21" + - "40250-40499" labels: logging: "promtail" haproxy: @@ -90,8 +130,11 @@ services: - app-network ports: - "21:21" + - "3306:3306" - "40000-40499:40000-40499" - "8404:8404" + labels: + logging: "promtail" keepalived: image: alpine:latest container_name: keepalived @@ -108,9 +151,13 @@ services: image: grafana/promtail:2.9.3 container_name: promtail restart: unless-stopped + environment: + TZ: Europe/Rome volumes: - ./promtail-config.yml:/etc/promtail/config.yml:ro - /var/run/docker.sock:/var/run/docker.sock:ro + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro networks: - app-network networks: diff --git a/vm1/env/ftp.ini b/vm1/env/ftp.ini index b52b626..af27fe8 100644 --- a/vm1/env/ftp.ini +++ b/vm1/env/ftp.ini @@ -2,7 +2,7 @@ # python3 -c 'from hashlib import sha256;print(sha256("????password???".encode("UTF-8")).hexdigest())' [ftpserver] - service_port = 2121 + service_port = 21 firstPort = 40000 proxyAddr = 0.0.0.0 portRangeWidth = 500 diff --git a/vm1/haproxy.cfg b/vm1/haproxy.cfg index ec9b08c..78c3045 100644 --- a/vm1/haproxy.cfg +++ b/vm1/haproxy.cfg @@ -22,7 +22,7 @@ frontend mysql_frontend backend mysql_backend mode tcp - server mysql1 192.168.1.201:3306 check + server mysql1 mysql:3306 check frontend ftp_control bind *:21 @@ -30,17 +30,24 @@ frontend ftp_control backend ftp_servers mode tcp - balance source + balance roundrobin server ftp1 ftp-server-1:21 check - server ftp2 192.168.1.202:21 check + server ftp1b ftp-server-1b:21 check -frontend ftp_passive - bind *:40000-40499 +frontend ftp_passive_1 + bind *:40000-40249 mode tcp - default_backend ftp_passive_servers + default_backend ftp_passive_1_backend -backend ftp_passive_servers +backend ftp_passive_1_backend mode tcp - balance source server ftp1 ftp-server-1:40000 check port 21 - server ftp2 192.168.1.202:40000 check port 21 + +frontend ftp_passive_1b + bind *:40250-40499 + mode tcp + default_backend ftp_passive_1b_backend + +backend ftp_passive_1b_backend + mode tcp + server ftp1b ftp-server-1b:40250 check port 21 diff --git a/vm2/docker-compose.yml b/vm2/docker-compose.yml index d628ed3..9354c01 100644 --- a/vm2/docker-compose.yml +++ b/vm2/docker-compose.yml @@ -7,8 +7,11 @@ services: environment: DB_HOST: ${VIP:-192.168.1.210} ORCHESTRATOR_ID: 4 + TZ: Europe/Rome volumes: - app-logs:/app/logs + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro networks: - app-network labels: @@ -21,8 +24,11 @@ services: environment: DB_HOST: ${VIP:-192.168.1.210} ORCHESTRATOR_ID: 5 + TZ: Europe/Rome volumes: - app-logs:/app/logs + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro networks: - app-network labels: @@ -35,8 +41,11 @@ services: environment: DB_HOST: ${VIP:-192.168.1.210} ORCHESTRATOR_ID: 6 + TZ: Europe/Rome volumes: - app-logs:/app/logs + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro networks: - app-network labels: @@ -49,12 +58,40 @@ services: environment: DB_HOST: ${VIP:-192.168.1.210} FTP_INSTANCE_ID: 2 + TZ: Europe/Rome + FTP_PASSIVE_PORT: "40000" + FTP_EXTERNAL_IP: ${VIP:-192.168.1.210} volumes: - app-logs:/app/logs + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro networks: - app-network expose: - "21" + - "40000-40249" + labels: + logging: "promtail" + ftp-server-2b: + build: . + container_name: ftp-server-2b + restart: unless-stopped + command: ["python", "-m", "src.ftp_csv_receiver"] + environment: + DB_HOST: ${VIP:-192.168.1.210} + FTP_INSTANCE_ID: 8 + TZ: Europe/Rome + FTP_PASSIVE_PORT: "40250" + FTP_EXTERNAL_IP: ${VIP:-192.168.1.210} + volumes: + - app-logs:/app/logs + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro + networks: + - app-network + expose: + - "21" + - "40250-40499" labels: logging: "promtail" haproxy: @@ -67,8 +104,11 @@ services: - app-network ports: - "21:21" + - "3306:3306" - "40000-40499:40000-40499" - "8404:8404" + labels: + logging: "promtail" keepalived: image: alpine:latest container_name: keepalived @@ -85,9 +125,13 @@ services: image: grafana/promtail:2.9.3 container_name: promtail restart: unless-stopped + environment: + TZ: Europe/Rome volumes: - ./promtail-config.yml:/etc/promtail/config.yml:ro - /var/run/docker.sock:/var/run/docker.sock:ro + - /etc/localtime:/etc/localtime:ro + - /etc/timezone:/etc/timezone:ro networks: - app-network networks: diff --git a/vm2/env/ftp.ini b/vm2/env/ftp.ini index b52b626..af27fe8 100644 --- a/vm2/env/ftp.ini +++ b/vm2/env/ftp.ini @@ -2,7 +2,7 @@ # python3 -c 'from hashlib import sha256;print(sha256("????password???".encode("UTF-8")).hexdigest())' [ftpserver] - service_port = 2121 + service_port = 21 firstPort = 40000 proxyAddr = 0.0.0.0 portRangeWidth = 500 diff --git a/vm2/haproxy.cfg b/vm2/haproxy.cfg index f00e8ca..18c10b6 100644 --- a/vm2/haproxy.cfg +++ b/vm2/haproxy.cfg @@ -30,17 +30,24 @@ frontend ftp_control backend ftp_servers mode tcp - balance source - server ftp1 192.168.1.201:21 check + balance roundrobin server ftp2 ftp-server-2:21 check + server ftp2b ftp-server-2b:21 check -frontend ftp_passive - bind *:40000-40499 +frontend ftp_passive_2 + bind *:40000-40249 mode tcp - default_backend ftp_passive_servers + default_backend ftp_passive_2_backend -backend ftp_passive_servers +backend ftp_passive_2_backend mode tcp - balance source - server ftp1 192.168.1.201:40000 check port 21 server ftp2 ftp-server-2:40000 check port 21 + +frontend ftp_passive_2b + bind *:40250-40499 + mode tcp + default_backend ftp_passive_2b_backend + +backend ftp_passive_2b_backend + mode tcp + server ftp2b ftp-server-2b:40250 check port 21