forked from cerc-io/stack-orchestrator
6bef0c5b2f
* Separate out uniswap gql proxy in a stack * Use proxy server from watcher-ts * Add a flag to enable/disable the proxy server * Update env configuratoin for uniswap urbit app stack * Update stack file for uniswap urbit app stack * Fix env variables in instructions |
||
---|---|---|
.. | ||
README.md | ||
stack.yml |
Proxy Server
Instructions to setup and deploy a HTTP proxy server
Setup
Clone required repository:
laconic-so --stack proxy-server setup-repositories --pull
# If this throws an error as a result of being already checked out to a branch/tag in a repo, remove the repositories mentioned below and re-run the command
Build the container image:
laconic-so --stack proxy-server build-containers
Create a deployment
-
First, create a spec file for the deployment, which will allow mapping the stack's ports and volumes to the host:
laconic-so --stack proxy-server deploy init --output proxy-server-spec.yml
-
Edit
network
in spec file to map container ports to same ports in host:... network: ports: proxy-server: - '4000:4000' ...
-
Once you've made any needed changes to the spec file, create a deployment from it:
laconic-so --stack proxy-server deploy create --spec-file proxy-server-spec.yml --deployment-dir proxy-server-deployment
-
Inside the deployment directory, open the file
config.env
and set the following env variables:# Whether to run the proxy server (Optional) (Default: true) ENABLE_PROXY= # Upstream endpoint # (Eg. https://api.example.org) CERC_PROXY_UPSTREAM= # Origin header to be used (Optional) # (Eg. https://app.example.org) CERC_PROXY_ORIGIN_HEADER=
Start the stack
Start the deployment:
laconic-so deployment --dir proxy-server-deployment start
-
List and check the health status of the container using
docker ps
-
The proxy server will now be listening at http://localhost:4000
Clean up
To stop the service running in background:
laconic-so deployment --dir proxy-server-deployment stop