Create a api gateway and serve ssl
mkcert -install
mkcert "*.local.gd" local.gd| services: | |
| # curl https://api.local.gd:8080/api | |
| api: | |
| image: devopsfaith/krakend:2.9.1 | |
| ports: | |
| - "8080:8080" | |
| volumes: | |
| - ./krakend.json:/etc/krakend/krakend.json | |
| - ./certs:/certs | |
| backend: | |
| image: busybox | |
| init: true | |
| working_dir: /www | |
| command: httpd -v -f -p 80 | |
| ports: | |
| - "8099:80" | |
| volumes: | |
| - ./backend:/www | |
| { | |
| "version": 3, | |
| "tls": { | |
| "public_key": "/certs/fullchain.pem", | |
| "private_key": "/certs/privkey.pem" | |
| }, | |
| "name": "My API Gateway", | |
| "timeout": "3000ms", | |
| "cache_ttl": "300s", | |
| "endpoints": [ | |
| { | |
| "endpoint": "/api", | |
| "method": "GET", | |
| "backend": [ | |
| { | |
| "url_pattern": "/", | |
| "host": ["http://backend"], | |
| "encoding": "json" | |
| } | |
| ] | |
| } | |
| ] | |
| } |