Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

Docker images & port mapping. #2881

Closed
mcbridet opened this issue May 30, 2016 · 7 comments
Closed

Docker images & port mapping. #2881

mcbridet opened this issue May 30, 2016 · 7 comments

Comments

@mcbridet
Copy link

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!

@titanous
Copy link
Contributor

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

@mcbridet
Copy link
Author

Thanks mate, much appreciated.

@Tyler-Murphy
Copy link

How would you recommend doing this with flynn docker push?

@titanous
Copy link
Contributor

@Tyler-Murphy you can use flynn release show --json and flynn release update to set this up after the first push.

@Tyler-Murphy
Copy link

That works great. Thanks!

@SalvoLunar
Copy link

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

@ruiisidro
Copy link

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants