stack-orchestrator/stack_orchestrator/data/stacks/proxy-server
2023-12-05 19:12:52 +05:30
..
README.md Add a flag to enable/disable the proxy server 2023-12-05 19:12:52 +05:30
stack.yml Use proxy server from watcher-ts 2023-12-05 18:52:08 +05:30

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
    CERC_PROXY_UPSTREAM=
    
    # Origin header to be used (Optional)
    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