Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to run app with port mapping #16

Closed
artofhuman opened this issue Feb 5, 2017 · 3 comments
Closed

Allow to run app with port mapping #16

artofhuman opened this issue Feb 5, 2017 · 3 comments

Comments

@artofhuman
Copy link
Contributor

For example, I have compose file:

› cat docker-compose.yml
version: '2'

services:
  web:
    build: '.'
    command: 'bash -c "bundle exec hanami server -p 3000 --host 0.0.0.0"'
    environment:
      - SSH_AUTH_SOCK=/ssh/auth/sock
    ports:
      - '3000:3000'
    volumes:
      - '.:/app'
      - ssh-data:/ssh:ro
    depends_on:
      - db

and dip.yml

...

  hanami:
    service: web

    subcommands:
      server:
        service: web

If i run server through dip:
DIP_DEBUG=1 dip hanami server

"docker-compose --file docker-compose.yml --project-name auto run -e HANAMI_ENV=development --rm web"
b1596b2a4c43        auto                            "bash -c 'bundle exec"   2 days ago          Up 2 seconds        3000/tcp                     auto_web_run_1

Port mapping not work.
For simple applications which don't use dns we should allow run app server with port mapping.
compose command should be with --service-ports

docker-compose --file docker-compose.yml --project-name auto run -e HANAMI_ENV=development --service-ports --rm web
4c90c609da55        auto                            "bash -c 'bundle exec"   2 days ago          Up 4 seconds        0.0.0.0:3000->3000/tcp       auto_web_run_1

maybe we should use special option in dip.yml ports: true?

hanami
  service: web
  
   subcommands:
     server:
       service: web
       ports: true

What do u think?

@deniskorobicyn
Copy link
Contributor

What if we call it same way as in compose -

hanami
  service: web
  
   subcommands:
     server:
       service: web
       service_ports: true

?

@artofhuman
Copy link
Contributor Author

I think about another way to pass any args, it can be useful

hanami
  service: web
  
   subcommands:
     server:
       service: web
       compose_run_args:
          - service-ports
          - no-deps

@bibendi
Copy link
Owner

bibendi commented Feb 6, 2017

I like the last option with compose_run_args.

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

No branches or pull requests

3 participants