ADI-Labs / density

wireless density API
13 stars 26 forks source link

add Dockerfile & Consul #113

Closed natebrennand closed 9 years ago

natebrennand commented 9 years ago
natebrennand commented 9 years ago

@thebrianzeng, Consul is what I was suggesting. It's simple to use with python. It'll make things simple when multiple services are utilizing the same database instance as well as simplify getting Docker work easily since you just expose the port that Consul is running on for configuration. Then there is no state maintained in the Docker image.

thebrianzeng commented 9 years ago

i'll look into Consul more deeply on friday - seems pretty promising.

natebrennand commented 9 years ago

So I added code to use gunicorn & updated the vagrant so that Docker works on it (had to go from 12.04 -> 14.04). If you guys are fine with Consul, I'll add that integration as well and then this should be good to go. As is, a lot of environment variables have to be passed in through the docker run command

thebrianzeng commented 9 years ago

I think Consul's a good idea - go for it

On Mon, Mar 2, 2015 at 11:16 AM Nate notifications@github.com wrote:

So I added code to use gunicorn & updated the vagrant so that Docker works on it (had to go from 12.04 -> 14.04). If you guys are fine with Consul, I'll add that integration as well and then this should be good to go. As is, a lot of environment variables have to be passed in through the docker run command

— Reply to this email directly or view it on GitHub https://github.com/adicu/density/pull/113#issuecomment-76741738.

natebrennand commented 9 years ago

@thebrianzeng, description updated and PR is ready for review

thebrianzeng commented 9 years ago

i'm trying to test this out and i'm getting

==> default: E: Unable to locate package docker.io
==> default: E: Couldn't find any package by regex 'docker.io'
==> default: restart: unrecognized service
==> default: Reading package lists...
==> default: Building dependency tree...
==> default:
==> default: Reading state information...
==> default: Suggested packages:
==> default:   zip
==> default: The following NEW packages will be installed:
==> default:   unzip
==> default: 0 upgraded, 1 newly installed, 0 to remove and 188 not upgraded.
==> default: Need to get 194 kB of archives.
==> default: After this operation, 386 kB of additional disk space will be used.
==> default: Get:1 http://us.archive.ubuntu.com/ubuntu/ precise-updates/main unzip amd64 6.0-4ubuntu2.3 [194 kB]
==> default: dpkg-preconfigure: unable to re-open stdin: No such file or directory
==> default: Fetched 194 kB in 0s (2,691 kB/s)
==> default: Selecting previously unselected package unzip.
==> default: (Reading database ...
==> default: 52471 files and directories currently installed.)
==> default: Unpacking unzip (from .../unzip_6.0-4ubuntu2.3_amd64.deb) ...
==> default: Processing triggers for man-db ...
==> default: Setting up unzip (6.0-4ubuntu2.3) ...
==> default: /tmp/vagrant-shell: line 71: curl: command not found
==> default: unzip:  cannot find or open 0.5.0_linux_amd64.zip, 0.5.0_linux_amd64.zip.zip or 0.5.0_linux_amd64.zip.ZIP.
==> default: mv: cannot stat `consul': No such file or directory
==> default: /tmp/vagrant-shell: line 75: curl: command not found
==> default: unzip:  cannot find or open 0.5.0_web_ui.zip, 0.5.0_web_ui.zip.zip or 0.5.0_web_ui.zip.ZIP.
==> default: mv: cannot stat `dist': No such file or directory

@natebrennand any ideas?

natebrennand commented 9 years ago

did you trash your old vagrant? you need to do vagrant destroy then vagrant up

thebrianzeng commented 9 years ago

further issue: when i run `sudo docker ps' i only get

CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
natebrennand commented 9 years ago

that's not an issue, it just means that you aren't running any containers

thebrianzeng commented 9 years ago

i got that after doing sudo docker run --net=host -d density

natebrennand commented 9 years ago

​​ make sure you have it working before you use the -d flag. That backgrounds it, idk how to access the image logs unless you kept track of the ID. You may need to use sudo docker stop $ID to end it after you start it up.

On Fri, Mar 6, 2015 at 3:06 PM, thebrianzeng notifications@github.com wrote:

i got that after doing sudo docker run --net=host -d density

— Reply to this email directly or view it on GitHub https://github.com/adicu/density/pull/113#issuecomment-77626254.

thebrianzeng commented 9 years ago

sweet, got it to work. :+1:

jzf2101 commented 9 years ago

:+1: yay!

eunicekokor commented 9 years ago

:100: