scalingexcellence / scrapybook

Scrapy Book Code
http://scrapybook.com/
475 stars 209 forks source link

Add docker-compose.yml so Vagrant not required. #35

Closed normangilmore closed 6 years ago

normangilmore commented 7 years ago

Since I have already have Docker installed on Ubuntu, I wanted to skip installing Vagrant and VirtualBox just to run Ubuntu inside of Ubuntu.

I have derived a docker-compose.yml from the Vagrantfile. So docker-compose up can be used to retrieve and start the containers.

It seems to start up all the containers just fine, and I can access the web and dev services, so I'm offering this in case it helps anyone else who doesn't want to install Vagrant and Virtualbox.

normangilmore commented 7 years ago

Note, docker-compose.yml can be used on all platforms that support docker-compose, including Docker for Mac, Docker for Windows, and the older Docker Toolbox for Mac and Windows.

lookfwd commented 7 years ago

Very nice, thanks!! Do you have any friends to do some "out of box" testing it? I will try it on my Mac and see how it goes. Also, could you append a bit on README.md showing ussage etc? Thanks once again :)

normangilmore commented 7 years ago

Sure, I will add some notes to the README. Also, I will test on Docker Toolbox for Windows. Probably this weekend.

Note if you are using Docker Toolbox for Mac or Windows, that installs Virtualbox behind the scenes, and the ports are bound to the internal Virtualbox IP, not localhost as you might expect. To find the internal IP address of Virtualbox, you will enter docker-machine ip or docker-machine ls. Usually it is 192.168.99.100. I guess Vagrant does the same thing, but I don't recall.

If you want to use localhost, the solution is to create ssh tunnels like this: ssh -L 9312:$(docker-machine ip):9312-L 6801:$(docker-machine ip):6801 docker@$(docker-machine ip) # password 'tcuser' (adjust as needed for all IPs needing to be tunneled.)

I guess I had been thinking that for people who know how to use docker-compose, they would see the file and know how it works on their Docker setup. But I will attempt to add the above information concisely to the README and you decide if it is clear enough or should be a separate README.

normangilmore commented 7 years ago

The containers seem to start up fine on my Ubuntu machine running Docker 17.03.1-ce, and also fine on Docker Toolbox for Windows 17.04.0-ce. I don't see any obvious errors messages pop out in the startup logging.

I've added instructions to the README, hope that helps.

lookfwd commented 6 years ago

Merging this. Thanks a lot!