Add a flag to enable/disable the proxy server
This commit is contained in:
parent
5a31d03fb0
commit
437eb27bd3
@ -3,12 +3,15 @@ version: "3.2"
|
|||||||
services:
|
services:
|
||||||
proxy-server:
|
proxy-server:
|
||||||
image: cerc/watcher-ts:local
|
image: cerc/watcher-ts:local
|
||||||
restart: unless-stopped
|
restart: on-failure
|
||||||
working_dir: /app/packages/cli
|
working_dir: /app/packages/cli
|
||||||
environment:
|
environment:
|
||||||
|
ENABLE_PROXY: ${ENABLE_PROXY:-true}
|
||||||
PROXY_UPSTREAM: ${CERC_PROXY_UPSTREAM}
|
PROXY_UPSTREAM: ${CERC_PROXY_UPSTREAM}
|
||||||
PROXY_ORIGIN_HEADER: ${CERC_PROXY_ORIGIN_HEADER}
|
PROXY_ORIGIN_HEADER: ${CERC_PROXY_ORIGIN_HEADER}
|
||||||
command: ["sh", "-c", "yarn proxy"]
|
command: ["sh", "-c", "./run.sh"]
|
||||||
|
volumes:
|
||||||
|
- ../config/proxy-server/run.sh:/app/packages/cli/run.sh
|
||||||
ports:
|
ports:
|
||||||
- "4000"
|
- "4000"
|
||||||
healthcheck:
|
healthcheck:
|
||||||
|
9
stack_orchestrator/data/config/proxy-server/run.sh
Executable file
9
stack_orchestrator/data/config/proxy-server/run.sh
Executable file
@ -0,0 +1,9 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
if [ "$ENABLE_PROXY" = "true" ]; then
|
||||||
|
echo "Proxy server enabled"
|
||||||
|
yarn proxy
|
||||||
|
else
|
||||||
|
echo "Proxy server disabled, exiting"
|
||||||
|
exit 0
|
||||||
|
fi
|
@ -46,6 +46,9 @@ laconic-so --stack proxy-server build-containers
|
|||||||
* Inside the deployment directory, open the file `config.env` and set the following env variables:
|
* Inside the deployment directory, open the file `config.env` and set the following env variables:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
|
# Whether to run the proxy server (Optional) (Default: true)
|
||||||
|
ENABLE_PROXY=
|
||||||
|
|
||||||
# Upstream endpoint
|
# Upstream endpoint
|
||||||
CERC_PROXY_UPSTREAM=
|
CERC_PROXY_UPSTREAM=
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user