Skip to main content

Deploying locally

Docker Compose

The easiest way to run Gate locally is by using Docker Compose.

docker-compose.yaml
version: "3.9"

services:
gate:
image: slashid/gate
ports:
- 8080:8080
command: [--env]
environment:
- GATE_PORT=8080
- GATE_DEFAULT_TARGET=http://example-service:8080
- GATE_LOG_FORMAT=text
- GATE_LOG_LEVEL=debug

example-service:
image: slashid/example-service
environment:
- PORT=8080

Deploying

To run this example, you should execute:

docker-compose up

To verify deployment, please run:

curl http://localhost:8080/

Now you can configure Gate for your needs. You can do it by checking configuration reference or list of all supported use cases.

Using different configuration formats

You can choose the desired configuration format through the gate command flags.

command: ["--env"]

For example, to run Gate with .yaml config:

docker-compose.yaml
version: "3.9"

services:
gate:
image: slashid/gate
ports:
- 8080:8080
command: [--yaml, /gate.yaml]
volumes:
- ./gate.yaml:/gate.yaml

example-service:
image: slashid/example-service
environment:
- PORT=8080
gate.yaml
gate:
default:
target: http://example-service:8080
port: "8080"
log:
format: text
level: info

All possible configuration formats are described on configuration page.