Giter VIP home page Giter VIP logo

Comments (6)

typicode avatar typicode commented on June 15, 2024

Hi @renegare

I think it's a really cool idea :)

I guess dockerIp and containerPort are not fixed, right? You can't just say: route myapp.ka to 1.2.3.4:3000?

PS: Not very familiar with Docker, so sorry for the questions.

from katon.

renegare avatar renegare commented on June 15, 2024

Yes you are right, dockerIp and containerPort must be variables because they change every time you run a given container (containerPort more so - docker thing).

The complex points to think about (as the script above specifically fits my setup) are:

  • OS - docker runs differently on windows and osx vs linux (which supports docker more natively)
  • Docker Container IP - due to how docker runs on osx or windows, this value will potentially change (on linux in dev environment, I believe the ip is just 127.0.0.1)
  • Docker Container Port - right now I'm using regex to match ports from a shel exec (not cool). Ideally you want to use docker daemon api (thats cool - using something like dockerode) for a more controlled integration

I guess what would be a good start is to figure out a simple use case around what you already have that makes use of docker. Then ensure the implementation is extendable. I'd hate to over complicate/engineer this simple script.

In terms of who will do it ... I will probably give it try over christmas ... presently mad busy, but happy to help test/clarify in the meantime if anyone feels to pick it up :)

from katon.

renegare avatar renegare commented on June 15, 2024

One last thing, if you don't know much about docker, google around to get a feel and if I were to conceptualise docker I would say:

a light weight version of vagrant that brings a the production environment closer to the developer of a given application.

But do google around to form your thoughts on the matter ;)

For me, having this feature in katon will make it easier for me to locally launch a whole heap of apps/services (basically an entire infrastructure) through actual (albeit virtual) domain names ... that makes testing / configuring things easier ... I don't enjoy configuring vagrant :p

from katon.

typicode avatar typicode commented on June 15, 2024

Thanks for all the explanations :)

I think it's better for ̀katon` to stay technology agnostic. So it would be better to create a third-party tool.

It could be something like this:

$ npm install -g docker-proxy 
$ katon add docker-proxy app-name

In your code, you would just have to retrieve port using process.env.PORT instead of argv.p.
And app-name could also be dynamically retrieved using req.headers.host.split('.').slice(-2, -1).pop().

It could be even used out of katon.

from katon.

renegare avatar renegare commented on June 15, 2024

Fair point, I was thinking about that from the very beginning, shall we close this then?

from katon.

typicode avatar typicode commented on June 15, 2024

Yes, closing :)
Feel free to message me when you create it. I'll add a link to katon's README.

from katon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.