I have some docker images that publish web services on ports that are not 80/443. Using docker run
, I can translate the non-standard port (8000, 8080 etc.) to 80 using the -p flag, such as docker run -p 127.0.0.1:80:8080 ...
https://docs.docker.com/engine/reference/commandline/run/#publish-or-expose-port-p-expose
Is there any way I can specify this sort of mapping in a config.json
file?
Many thanks!
Sure, you can do something like this:
{
"processes": {
"app": {
"ports": [
{
"proto": "tcp",
"port": 8000,
"service": {
"name": "myapp-web",
"create": true
}
}
]
}
}
}
Which would create a service that you can then create a HTTP or TCP route for:
flynn route add http -s myapp-web myapp.com
flynn route add tcp -s myapp-web
Thanks mate, much appreciated.
How would you recommend doing this with flynn docker push
?
@Tyler-Murphy you can use flynn release show --json
and flynn release update
to set this up after the first push.
That works great. Thanks!
Hi,
Can you please clarify how this works? I have a docker image with wordpress
Wordpress by default listens to port 80, should I map this to port 8080?
Thanks,
Salvo
I'm also struggling to get any docker image up and running on flynn. I'm always getting the "Service Unavailable" message. running docker image locally with -p parameter works fine, but when deploying to my flynn server it never works.
Most helpful comment
@Tyler-Murphy you can use
flynn release show --json
andflynn release update
to set this up after the first push.