ngrok can expose (tunnel) localhost to the outside world
Docker Hub has an image of wernight/ngrok (https://hub.docker.com/r/wernight/ngrok/). It is often used in the image of ngrok and is easy to use.
docker-compose.yml
version: "3.8"
networks:
default:
services:
nginx:
image: nginx:stable-alpine
container_name: nginx
ports:
- 80:80
networks:
- default
depends_on:
- app
ngrok:
image: wernight/ngrok:latest
ports:
- 4040:4040
environment:
NGROK_PROTOCOL: http
NGROK_PORT: nginx:80
#NGROK_AUTH: ${NGROK_AUTH}
depends_on:
- nginx
networks:
- default
The above exposes the nginx container as it is in ngrok.
Just specify the container name and port to expose, such as NGROK_PORT: nginx: 80
in environment
. NGROK_AUTH
is not required if you do not use services that require authentication.
It's convenient and it's easy to use, so it's helpful ...! It seems to be very useful when developing an SSL-required non-self-certified external API such as Linebot locally.
Recommended Posts