I have a webservice named “snapshot” on docker cloud BYON (on my own server) and i would like to deploy TYK on this server.
My snapshot WS is running with a stackfile on docker cloud (nodejs service and redis) and exposing the port 3000.
I don’t know how to deploy TYK on dockercloud via the docker cloud web interface so i’ve cloned the tyk_quickstart github repo on my server and launch it with the docker-compose file.
I can connect to the TYK Dashboard, but when i create a API for my snapshot WS deployed with a stackfile through the cloud.docker.com web interface, it seems the TYK gateway doesn’t see my snapshot WS and i get this error : “Upstream host lookup failed”. (http://apidomain/snapshot/)
How can i deploy TYK on dockercloud or how can i make “dockercloud” network and “gateway” network (from docker-compose) communicate together please ?
Docker cloud stackfiles are basically almost same as docker-compose configuration files.
I did not tried docker cloud yet (and this is something we are working on to have in our documentation and examples), but seems like removing “services” and “version” fields from docker-compose file https://github.com/TykTechnologies/tyk_quickstart/blob/master/docker-compose.yml should be enough to run it on docker cloud. You probably also need to create data volume, copy configuration files to it, and update “volumes” section in yml file.
How can i deploy TYK on dockercloud or how can i make “dockercloud” network and “gateway” network (from docker-compose) communicate together please ?
So, to summary: your API accessible only to internal docker cloud network, and your local app do not see it? If so, then for sure you should try run Tyk inside docker cloud, and include it to your stackfile along with your app. Another option will be make your API accessible to the public, but allow it only to IP address of your Tyk gateway (if docker cloud allows IP whitelisting): but well, it is for sure not so reliable as the first option.
I tried successfully to write a stackfile from the docker-compose file, here is my stackfile for your documentation and examples :
(you need to remove, “services”, “version”, “networks” (and aliases). I remove tyk_ prefixes in services names (because you cannot use underscores in service name in stackfile). I also remove useless “hostnames” and i replace http://tyk_dashboard:3000 to http://dashboard:3000 in tyk.conf file. And i set absolutes paths in volumes entries.
I was wondering if we could configure TYK through environments variables instead of externals config files in volumes entries (in order to wrap everything in only one single file and make it easier to manage) ?
Well, I’ll be honest, Tyk is very powerful platform with a lot of functionality and components. It is indeed possible to make it run without configuration files, but not sure if this will be useful for any use case, except tutorials. Or we can define few dozens of environment variables
I replaced “custom domain url” in the three API (created by default, in grey) to : developers.domain.com. When i click on the link Your Developer Portal > Open Your Portal, i get the error :
{
"error": "There was a problem proxying the request"
}
If you wish to change your portal domain - DO NOT USE the drop-down option in the navigation, instead, change the domain names in the three site entries in the API section. However, if you want clean URLs constructed for your APIs in the dashboard, setting this value will show the URLs for your APIs as relative to the domain you’ve set.
Do i need to specify the full configuration for each component ? Or, can i run all the components without specifying any configuration (file or env) ? Is there a “default” configuration ?
How can i change the “superadmin” password which is “12345” by default ? Can i change it with a environment variable ?
I don’t find the way to set the secretkey with environment variable ?
Each component has a default configuration, and theoretically, should run even without config (it will assume that all databases on localhost). I can guarantee that it works for Tyk Gateway but rest of services needs to be tested.
For “admin” password try TYK_DB_ADMIN_SECRET variable.