refactor: route ae_app through ae_web_dev like ae_api

Both API and App now scale transparently via Docker DNS round-robin.
Home server nginx points at a single port for each service:
  - workstation:5060 -> ae_web_dev:80 -> ae_api replicas
  - workstation:3001 -> ae_web_dev:80 -> ae_app replicas

ae_app no longer needs host port bindings. AE_APP_REPLICAS scales freely.
HTTPS (443) commented out -- SSL terminates at home server, not internally.
This commit is contained in:
Scott Idem
2026-03-10 18:16:06 -04:00
parent 0ea5373390
commit 57ec65144d

View File

@@ -14,9 +14,10 @@ services:
- NGINX_SERVER_NAMES="flask_gunicorn.localhost demo.localhost dev.localhost dev.oneskyit.com dev-app.oneskyit.com dev-connect.oneskyit.com dev-demo.oneskyit.com dev-aacc.oneskyit.com dev-aapor.oneskyit.com dev-ascm.oneskyit.com dev-businessgroup.oneskyt.com dev-chow.oneskyit.com dev-cmsc.oneskyit.com dev-idaa.oneskyit.com dev-ishlt.oneskyit.com dev-lci.oneskyit.com dev-ncsd.oneskyit.com dev-npa.oneskyit.com dev-rli.oneskyit.com test-app.oneskyit.com" - NGINX_SERVER_NAMES="flask_gunicorn.localhost demo.localhost dev.localhost dev.oneskyit.com dev-app.oneskyit.com dev-connect.oneskyit.com dev-demo.oneskyit.com dev-aacc.oneskyit.com dev-aapor.oneskyit.com dev-ascm.oneskyit.com dev-businessgroup.oneskyt.com dev-chow.oneskyit.com dev-cmsc.oneskyit.com dev-idaa.oneskyit.com dev-ishlt.oneskyit.com dev-lci.oneskyit.com dev-ncsd.oneskyit.com dev-npa.oneskyit.com dev-rli.oneskyit.com test-app.oneskyit.com"
ports: ports:
- "${OSIT_WEB_HTTP_PORT}:80" - "${OSIT_WEB_HTTP_PORT}:80" # LAN HTTP (local access without SSL)
- "${OSIT_WEB_HTTPS_PORT}:443" # - "${OSIT_WEB_HTTPS_PORT}:443" # HTTPS — not needed internally; terminate SSL at home server
- "${AE_API_GATEWAY_PORT}:80" - "${AE_API_GATEWAY_PORT}:80" # API gateway: home nginx → workstation:5060 → ae_api replicas
- "${AE_APP_GATEWAY_PORT}:80" # App gateway: home nginx → workstation:3001 → ae_app replicas
volumes: volumes:
- ./srv/html_php:/srv/html_php - ./srv/html_php:/srv/html_php
- ./srv/oneskyit_site:/srv/oneskyit_site - ./srv/oneskyit_site:/srv/oneskyit_site
@@ -35,6 +36,7 @@ services:
- ./logs/web:/logs - ./logs/web:/logs
depends_on: depends_on:
- ae_api - ae_api
- ae_app
# - aether_app_gunicorn # - aether_app_gunicorn
logging: logging:
driver: "json-file" driver: "json-file"
@@ -145,12 +147,8 @@ services:
scale: ${AE_APP_REPLICAS:-1} scale: ${AE_APP_REPLICAS:-1}
env_file: env_file:
- ./.env - ./.env
ports: # No host ports — ae_web_dev proxies to ae_app:3000 via Docker DNS,
# Port range allows scaling: Docker assigns one host port per replica. # round-robining across all replicas. Scale freely with AE_APP_REPLICAS.
# e.g. AE_APP_NODE_PORT_RANGE=3001-3006 with AE_APP_REPLICAS=3 binds
# 3001→replica-1, 3002→replica-2, 3003→replica-3.
# Add matching ports to the external nginx upstream to enable them.
- "${AE_APP_NODE_PORT_RANGE:-3001-3001}:3000"
extra_hosts: extra_hosts:
srv-nyx.oneskyit.com: "104.237.143.4" srv-nyx.oneskyit.com: "104.237.143.4"
dev-app.oneskyit.com: "104.237.143.4" dev-app.oneskyit.com: "104.237.143.4"