Split gateway control and dataplane into separate services
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
APP_COMPONENT="${APP_COMPONENT:-combined}"
|
||||
TPROXY_PORT="${TPROXY_PORT:-7895}"
|
||||
TPROXY_MARK="${TPROXY_MARK:-1}"
|
||||
TPROXY_TABLE="${TPROXY_TABLE:-100}"
|
||||
@@ -19,6 +20,10 @@ log() {
|
||||
printf '[gateway-entrypoint] %s\n' "$*"
|
||||
}
|
||||
|
||||
if [[ "$APP_COMPONENT" == "control" ]]; then
|
||||
exec node /app/src/server/index.js
|
||||
fi
|
||||
|
||||
ipt() {
|
||||
iptables -w "$@"
|
||||
}
|
||||
@@ -110,7 +115,11 @@ setup_gateway_forwarding
|
||||
setup_tproxy
|
||||
setup_proxy_firewall
|
||||
|
||||
node /app/src/server/index.js &
|
||||
if [[ "$APP_COMPONENT" == "dataplane" ]]; then
|
||||
node /app/src/server/dataplane.js &
|
||||
else
|
||||
node /app/src/server/index.js &
|
||||
fi
|
||||
APP_PID=$!
|
||||
|
||||
shutdown() {
|
||||
|
||||
Reference in New Issue
Block a user