7 ms·
Something I've been trying to figure out lately that I'm hitting dead ends with: I just want to deploy a few containers to a single server. I don't want a swar
by dchuk 10y ago
Something I've been trying to figure out lately that I'm hitting dead ends with: I just want to deploy a few containers to a single server.
I don't want a swarm or high availability, I just have some rails containers in dev that I want to run on a medium sized droplet. But there's nothing really out there on how to do this in a straightforward way.
I'm at the point where it seems like I can use ssh kit and docker compose to sort of do this, but it won't be zero downtime deploy and I have to script it up. It looks like there's a docker machine option, but I'm currently using docker for Mac so I'm not even sure where to begin for that path.
Docker is super powerful, but we don't all have 500 host deployments. I just need something quick that I can toss on a $20 vps easily.
- alexbilbie 10y agoCould you just run docker-compose on your server to keep some containers running?
- dchuk 10y agoThat's what I'm planning on at this point. The part below the CI stuff in this article basically captures what I want to do: http://chrisstump.online/2016/03/17/continuous-deployment-docker-rails/ http://chrisstump.online/2016/03/17/continuous-deployment-do... I just wish there were more resources for small-medium docker deployments online. It seems like Rancher could help in this situation, but even that is pretty heavy for small deployments.
- kentt 10y agoA word of warning, docker-compose isn't meant for production. I'm not sure if that's what you're suggesting, but just in case.
- siegecraft 10y agoWait, then why does Docker force it on you with Docker 1.11/Docker DataCenter? The only way to start a multi-container application with that product is to use docker-compose.
- zenlikethat 10y agoFWIW, one thing the new Swarm mode stuff includes is support for rolling updates, so that e.g. you could have two containers behind a load balancer and roll out a new image without (or more likely to start, with minimal) downtime. Even on a single host this is useful, but you do still need a little shell glue. I do agree that the "medium size" (useful to the vast majority of people) documentation resources that are available are quite inadequate today.
- rlyshw 10y agoI'm in the process of building a system to do just that; super easy, small to medium container deployment. It's still a WIP and there's not much (or any) documentation, but if it generates some interest I'll work on it more and maybe post a Show HN. In short, all you have to do is POST a url to a github repo and the system will pull your code, build a docker image from your Dockerfile, spin up a container, and then reverse proxy to the container's IP. All you have to do is provide a repo with a Dockerfile and the deployment system does the rest. Here's the code for it; https://gitlab.rlyshw.com/rlyshw/tiny-deploy https://gitlab.rlyshw.com/rlyshw/tiny-deploy and here is an outdated blog post that outlines how it works; https://blog.rlyshw.com/2016/07/13/home-brew-deployment-system-2/ https://blog.rlyshw.com/2016/07/13/home-brew-deployment-syst...
- bonsai80 10y agoI have been in a similar place lately. We have a primary rails application with 1 other web service and a DB. We looked at docker machine, docker swarm, and tutum (now a docker hub feature). None were very clear to use. Right now we've settled on Kubernetes and couldn't be happier. It was quite daunting at first as their docs aren't very newcomer friendly, but after a few youtube videos to get the ideas straight, it feels like the perfect way to deploy and orchestrate dockerized applications. You mention using Digital Ocean - you should reach out to Bryan Liles there, who is a super sharp and friendly guy and can help you with Kubernetes on DI. We'll probably be using Google's stuff for our deployments, but with Kubernetes it really doesn't matter anymore. Hope that helps!
- wstrange 10y agoYou might want to check out minikube. https://github.com/kubernetes/minikube https://github.com/kubernetes/minikube Super easy way to get Kubernetes running on a single host.
- franey 10y agoIn my experience Dokku is perfect for this. It uses Heroku's buildpacks to build your app inside a Docker container (or containers) and serves it on yourapp.yourserver.com via a git push: https://github.com/dokku/dokku https://github.com/dokku/dokku I've got ~5 low-traffic websites running on a 1GB Droplet.
- KurtMueller 10y agoHow long have you been using Dokku?
- franey 10y agoI've been using it for quite a while! At least since September 7, 2015 (thanks, GitHub), and it's come a long way since then.
- maximz 10y agoI may have what you're looking for: I've been working on exactly this problem, because I grew tired of the headaches from maintaining a "snowflake server" (http://martinfowler.com/bliki/SnowflakeServer.html http://martinfowler.com/bliki/SnowflakeServer.html), which I configured once in the past and would be very difficult to reproduce. Here's a super-simple Docker host stack I put together that you can install on a cloud machine fairly easily. It runs Docker containers, does automatic backups, and has monitoring and alerting built-in. I've run around 5 webapps, split between 10 containers, on this infrastructure for about 6 months with significantly fewer headaches. Monitoring alerts go straight into a personal Slack channel. The implementation is deliberately low-level -- you'll be running bare docker commands -- because the goal is to have a trivial infrastructure and to learn Docker in the process. There's no reliance on the "magic" in big wrappers like Kubernetes. Because there's nothing fancy in here, it's simple to understand and use. My write-up is rough around the edges right now, but eventually this will turn into a simple blog post with an Ansible playbook attached. Here's a rough draft of how to set it up manually: https://github.com/maximz/docker-host/blob/master/public_docker_host_config.pdf https://github.com/maximz/docker-host/blob/master/public_doc... There's an nginx reverse proxy fronting the Docker containers. You can do a zero-downtime deploy pretty easily. Happy to answer any questions if they arise.
- dchuk 10y agoAwesome I will take a look!
- biscarch 10y agoIf you go the docker-machine route, you can do the following. brew install docker-machine docker-machine create --name myserver ...digital-ocean-options eval $(docker-machine env myserver) docker ps that is: * install docker-machine * provision a droplet with docker on it (you can also use test.docker.com to use an RC instead of the latest release) * set your local shell env to point docker to said machine * use the docker client to interact with said machine I also use docker-for-mac and a similar process to spin up swarm-mode clusters. You can also ssh into the machine if you need to by `docker-machine ssh myserver` [0]: https://docs.docker.com/machine/drivers/digital-ocean/ https://docs.docker.com/machine/drivers/digital-ocean/
- dchuk 10y agoVery cool, I'll give this a shot!
- dmix 10y agoThis is a pretty standard use-case from my experience. I'm new to docker but I work with a lot of different startups via consulting and they are all starting to use docker and almost everyone is using docker-compose, and/or docker-machine for their set ups. It's probably worth investing in learning docker-compose.