Docker
Introduction
We will show you two methods of installing our Community Edition Gateway on Docker. The quickest way to get started is using docker-compose. Visit our Dockerhub to view the official images.
Prerequisites
The following are required for a Tyk OSS installation:
- Redis - required for all Tyk installations. Simple redis installation instructions are included below.
- MongoDB - Required only if you chose to use the MongoDB Tyk pump with your Tyk OSS installation. Same goes with any other pump you choose to use.
We have a Killercoda scenario that walks through installing our Open Source Gateway on Docker:
Tyk OSS: Deploy on Docker using Docker Compose
Note
You will need a free Killercoda account to access the scenario.
Installation
Step 1 - Clone the docker-compose repository
git clone https://github.com/TykTechnologies/tyk-gateway-docker
Output:
Cloning into 'tyk-gateway-docker'...
Step 2 - Change to the new directory
cd tyk-gateway-docker
Step 3 - Deploy Tyk Gateway and Redis
docker-compose up -d
Step 1 - Let’s create a network
docker network create tyk
Step 2 - Deploy Redis into the network, with the 6379
port open
docker run -itd --rm --name tyk-redis --network tyk -p 127.0.0.1:6379:6379 redis:4.0-alpine
Step 3 - Next, let’s download a JSON tyk.conf
configuration file.
wget https://raw.githubusercontent.com/TykTechnologies/tyk-gateway-docker/master/tyk.standalone.conf
Step 4 - Run the Gateway, mounting the conf file into the container:
docker run \
--name tyk_gateway \
--network tyk \
-p 8080:8080 \
-v $(pwd)/tyk.standalone.conf:/opt/tyk-gateway/tyk.conf \
-v $(pwd)/apps:/opt/tyk-gateway/apps \
docker.tyk.io/tyk-gateway/tyk-gateway:latest
Congratulations, you’re done! Your Tyk Gateway is now configured and ready to use. Confirm this by checking against the ‘hello’ endpoint:
curl localhost:8080/hello
Output:
{"status":"pass","version":"v3.2.1","description":"Tyk GW"}
Next Steps Tutorials
Follow the Tutorials on the Community Edition tabs for the following: