Hello,
I was trying to get Tyk On-Premises Gateway and Dashboard setup on my local machine using Docker when I ran into an issue. From following the instructions on your site†, I managed to put together this docker compose file:
version: '3'
services:
redis:
image: redis
container_name: tyk_redis
mongo:
image: mongo
container_name: tyk_mongo
pump:
image: tykio/tyk-pump-docker-pub
container_name: tyk_pump
depends_on:
- redis
- mongo
dashboard:
image: tykio/tyk-dashboard
container_name: tyk_dashboard
ports:
- '3000:3000'
depends_on:
- redis
- mongo
gateway:
image: tykio/tyk-gateway
container_name: tyk_gateway
ports:
- '8080:8080'
volumes:
- './tyk.with_dashboard.conf:/opt/tyk-gateway/tyk.conf'
depends_on:
- redis
- dashboard
Where I got the bind-mounted dashboard config file tyk.with_dashboard.conf from here.
When I did that, the gateway never registered with the dashboard. Instead, I got messages like these every 5 seconds:
gateway_1 | time="Jul 12 14:04:22" level=error msg="Response failed with code 404; retrying in 5s"
dashboard_1 | time="Jul 12 14:04:22" level=error msg="No nodes available"
gateway_1 | time="Jul 12 14:04:27" level=error msg="Response failed with code 404; retrying in 5s"
dashboard_1 | time="Jul 12 14:04:27" level=error msg="No nodes available"
dashboard_1 | time="Jul 12 14:04:32" level=error msg="No nodes available"
gateway_1 | time="Jul 12 14:04:32" level=error msg="Response failed with code 404; retrying in 5s"
dashboard_1 | time="Jul 12 14:04:37" level=error msg="No nodes available"
gateway_1 | time="Jul 12 14:04:37" level=error msg="Response failed with code 404; retrying in 5s"
That persisted even after I entered the licence key via the web interface.
After trying to debug this for a while, I discovered the tyk-pro-docker-demo GitHub repo. (I don’t remember how I found the link to it, but maybe there should be one on the Docker setup page in the docs.) When I cloned that repo and did its docker-compose command, I ran into that issue the first time, but things worked fine from the second time onwards. That seems to be because the docker-local.yml file in that repo includes a bind mount to a Tyk Dashboard config file on the host machine; the licence key is then stored in that file when it’s entered via the web interface during the first run, and that apparently allows it to work after a restart.
Should that restart be required? If it should, then maybe it should be documented as a required step somewhere in the setup instructions, maybe on the dashboard’s Docker Hub page.
Regards,
Kamal
† That is, I 1) followed the three links on the page for installing Tyk On-Premises using Docker to combine the commands into the Docker Compose file that I pasted above; and 2) I got a developer licence.