Comments (11)
This was tripping me out for a while, until I realized that "NGROK_PORT" can also have a container alias.
So I made it work with:
nginx:
depends_on:
- phpfpm
ports:
- "80:80"
- "443:443"
image: nginx:latest
volumes:
- "./wordpress:/var/www/html"
- "./config/nginx/default.conf:/etc/nginx/conf.d/default.conf"
- "./config/certs:/etc/nginx/certs"
- "./logs/nginx:/var/log/nginx"
restart: always
ngrok:
container_name: ngrok
ports:
- "0.0.0.0:4040:4040"
image: wernight/ngrok
links:
- "nginx"
environment:
- NGROK_AUTH=<>
- NGROK_SUBDOMAIN=<>
- NGROK_REGION=eu
- NGROK_PORT=nginx:80
from docker-ngrok.
Since "links" is legacy feature, I'd rather use "networks" especially since “links” doesn't work for me
due to error "The error encountered was: dial tcp: lookup nginx on 127.0.0.11:53: no such host"
This way works for me:
nginx:
image: nginx:alpine
container_name: nginx
restart: unless-stopped
tty: true
environment:
SERVICE_NAME: nginx
ports:
- 3000:80
volumes:
- ./src:/app
- ./docker/nginx/conf.d/:/etc/nginx/conf.d/
networks:
- app-network
ngrok:
container_name: ngrok
ports:
- "0.0.0.0:4040:4040"
image: wernight/ngrok
environment:
- NGROK_AUTH=<>
- NGROK_SUBDOMAIN=<>
- NGROK_REGION=eu
- NGROK_PORT=nginx:80
networks:
- app-network
networks:
app-network:
driver: bridge
from docker-ngrok.
Great job, so tiny image! But please add this - NGROK_PORT=nginx:80
to the readme, I've spent some time searching why environment variables does not working (ended up by looking source and entrypoint.sh
, then issues)
from docker-ngrok.
Using docker compose would also work without environment variables when you put the container in the same network:
ngrok:
container_name: ngrok
image: wernight/ngrok
command: ngrok http apache:8080
networks:
- apache
ports:
- '4040:4040'
from docker-ngrok.
There is no HTTP_PORT
env variable support. Where did you see that? See https://github.com/wernight/docker-ngrok
from docker-ngrok.
If I don't set it then the ngrok command does not execute appropriately.
In looking at the entrypoint.sh script I believe it is this portion that is hanging me up:
from docker-ngrok.
If I don't set it then the ngrok command does not execute appropriately.
In looking at the entrypoint.sh script I believe it is this portion that is hanging me up:
if [ -n "$HTTPS_PORT" ]; then
FWD="`echo $HTTPS_PORT | sed 's|^tcp://||'`"
elif [ -n "$HTTP_PORT" ]; then
FWD="`echo $HTTP_PORT | sed 's|^tcp://||'`"
elif [ -n "$APP_PORT" ]; then
FWD="`echo $APP_PORT | sed 's|^tcp://||'`"
fi
Maybe it is because I am using the newer 1.7 docker-compose and 1.11 docker?
from docker-ngrok.
I forgot why this is there but it works without, just following the README.
Can also use host:
$ docker run --rm -it --net=host wernight/ngrok ngrok http localhost:80
from docker-ngrok.
Added NGROK_PORT
, you may also use the command-line directly. Let me know if it helps.
from docker-ngrok.
@artpi saved my day.
from docker-ngrok.
Would you like to suggest a pull-request for the README change? As a user, you're in the best place to know how it could be worded.
from docker-ngrok.
Related Issues (20)
- Periodically rebuild image HOT 3
- api/tunnels returns empty response when using auth HOT 1
- Does not support spaces in password
- I need help to expose NextCloudPi
- Add NGROK_LOOK_DOMAIN commit to dockerhub HOT 1
- Updating NGROK docker and other questions HOT 1
- Receive ngrok url HOT 4
- Request: image version tag
- authtoken is not respecting in container HOT 1
- Nginx is showing always after generating ngrok url
- Cannot link to webcontainer
- Update? HOT 1
- Inspect Option Support? HOT 1
- multiple ports HOT 1
- transfer maintainership to ngrok? HOT 3
- Add ARM64 (Apple Silicon) support HOT 2
- NGROK_AUTH not working HOT 4
- Add ARM64 (Apple Silicon) support HOT 1
- Ngrok
- ERROR: unknown shorthand flag: 'o' in -ostname=my-app.ngrok.io HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-ngrok.