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

update: Added a basic Dockerfile #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

update: Added a basic Dockerfile #22

wants to merge 1 commit into from

Conversation

mrshu
Copy link
Contributor

@mrshu mrshu commented Dec 4, 2014

  • Added a basic Dockerfile with nodejs and mongodb to start to use
    tournamenter in a way it deserves.

Signed-off-by: mr.Shu [email protected]


This is a very first and very basic version of a Dockerfile that will in the end power tournamenter.

To get this, first of all you need to install docker (http://docs.docker.com/installation/mac/). Then you need to pull my build by running

docker pull mrshu/tournamenter

It's going to install a LOT of data (like around 800MB) but afterwards you can run

sudo docker run -p 12345:1337 -a stdin -a stdout -i -t mrshu/tournamenter 

Which will start tournamenter, open port 12345 on your machine and route the "internal" tournamenter's port (1337) into it. That way, tournamenter should be now available at http://127.0.0.1:12345/ on your machine.

@ivanseidel Do let me know if there are any problems with this -- would like to get them figured out.

* Added a basic Dockerfile with nodejs and mongodb to start to use
  tournamenter in a way it deserves.

Signed-off-by: mr.Shu <[email protected]>
@mrshu
Copy link
Contributor Author

mrshu commented Dec 4, 2014

Also, when you run the second command you should be seing the tournamenter output (just saying).

@mrshu mrshu mentioned this pull request Jan 2, 2015
@mrshu
Copy link
Contributor Author

mrshu commented Jan 2, 2015

@TechnoX feel free to play around this too, it might simplify the deployment for you.

@ivanseidel
Copy link
Member

Will play around now that i'm home! and connected to the internet as well...
On Jan 2, 2015 6:14 PM, "Marek Šuppa" [email protected] wrote:

@TechnoX https://github.com/TechnoX feel free to play around this too,
it might simplify the deployment for you.


Reply to this email directly or view it on GitHub
#22 (comment)
.

@mrshu
Copy link
Contributor Author

mrshu commented Jan 2, 2015

@ivanseidel take your time, there is no real rush in this =)

@ivanseidel
Copy link
Member

@mrshu this error occurs while using sudo:
FATA[0000] Post http:///var/run/docker.sock/v1.16/containers/create: dial unix /var/run/docker.sock: no such file or directory. Are you trying to connect to a TLS-enabled daemon without TLS?

@mrshu
Copy link
Contributor Author

mrshu commented Jan 3, 2015

@ivanseidel my bad, on Mac machines you should not be using sudo at all (moby/moby#9808). Can you please try it without it?

@ivanseidel
Copy link
Member

I tried without sudo as well (started up just ok), but couldn't access it in the browser... I thought that sudo was required. Any thoughts?

@mrshu
Copy link
Contributor Author

mrshu commented Jan 4, 2015

@ivanseidel it seems that this boot2docker thing changes all the time. The problem is that it doesn't bind 0.0.0.0 or 127.0.0.1 but some other strange IP so you need to open that.

Please see https://github.com/boot2docker/boot2docker#container-port-redirection and do let me know if that helps.

@mrshu
Copy link
Contributor Author

mrshu commented Jan 4, 2015

@ivanseidel Generally speaking you only need to change the 127.0.0.1 to whatever boot2docker ip prints out.

@ivanseidel
Copy link
Member

Roger That.

Worked... but how to do something pretty and easier for dummies? haha

I guess everything should work just by copying and pasting something in the terminal... what do you think?

@mrshu
Copy link
Contributor Author

mrshu commented Jan 4, 2015

@ivanseidel absolutely, will create a script for that!

@ivanseidel
Copy link
Member

Once I found something really nice like this... script was written in shell, and was downloaded and runned using curl I guess. Let me try to find out where it is...

@mrshu
Copy link
Contributor Author

mrshu commented Jan 4, 2015

It seems to be everywhere these days and frankly, it's very insecure and generally a bad practice.

But for tournamenter it seems to be the way to go.

@ivanseidel did you mean something like this?

curl https://www.npmjs.org/install.sh | sh

@ivanseidel
Copy link
Member

yeah @mrshu .. exactly! haha
I know it's (extremely) insecure, but as you said... maybe it's the right path to follow. We can even host it on GitHub..

Do you need any help? I think of this line of events:

  • Download Docker, Install.
  • Run VM, Pull tournamenter latest version
  • Create a configuration file (tournamenter_settings.json? on desktop or current directory (that will be used to start tournamenter, with custom options)
  • Run tournamenter (and maybe watch for changes to the tournamenter_settings.json? and restart when something has changed...)
  • Run tournamenter with settings, and somehow, show the ip to connect to tournamenter...

Also, if user executes the same shell again, it should skip instalation steps...

What do you think?

@mrshu
Copy link
Contributor Author

mrshu commented Jan 4, 2015

I believe I can do this fairly easily. I'd say let's concentrate on Mac and Linux machines first and figure out Windows afterwards (but it should be easy to do it there too).

A few comments:

  • Downloading Docker is something that should not happen in this script (especially on Mac, I do not know how to install it, probably via homebrew?). But I agree that it should be the only other thing except for this script you would need to run it.

  • Run VM, Pull tournamenter latest version

    -- very much doable

  • Create a configuration file (tournamenter_settings.json? on desktop or current directory (that will be used to start tournamenter, with custom options)

    -- current directory would be way easier, we could probably have a folder for multiple of them?

  • Run tournamenter (and maybe watch for changes to the tournamenter_settings.json? and restart when something has changed...)

    -- watching for changes is a bit tricky thing to do in a cross-platform manner but will look into that too.

  • Run tournamenter with settings, and somehow, show the ip to connect to tournamenter...

    -- this should not be a big deal if we manage to detect that we are on a Mac.

Also, if user executes the same shell again, it should skip instalation steps...

Totally agreed.

Sounds like a good plan! Just one question, if there will be some config values in tournamenter_settings.json, how do we send them into the actual docker instance? One way of doing that would be using environemental variables (which you can then read via process.env.ENV_VARIABLE). If we decide to go this way, it might be a good idea to keep the config file simple so that the shell script will not have to actually parse JSON =)

@ivanseidel
Copy link
Member

What I was thinking about, is creating a settings file like:
tourmaneters.json:

[
   {
      "env.APP_NAME": "My Tournamenter 1",
      "port": 80, [...]
    },
   {
      "env.APP_NAME": "My Tournamenter 2",
      "port": 81, [...]
    },
]

Or something like this... that we could insert tournamenter instances, and each object keys represents an argument to be added in the startup.. My objective with this, is to create a simplesettings` file, where people could change things there, without having to write the params itself... What do you think @mrshu ?

@mrshu
Copy link
Contributor Author

mrshu commented Jan 4, 2015

@ivanseidel I see. If at that moment we would also require people to install say node on their boxes that would make total sense.

Let's roll with that for now then!

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

Successfully merging this pull request may close these issues.

2 participants