Hi,

I have a Rails-based web application which I am running locally on a development machine which uses Docker Desktop for mac.

The application comprises of several services, and have used a docker-compose file to co-ordinate.

To get to this point I have been using the book, Docker for Rails Developers as a guide.

It has also been helpful in guiding me to adapting the code for a production environment by creating a Dockerfile.prod with some production specific behaviour.

I have also uploaded the relevant docker images for my web app and another service to Docker Hub so they are available to use.

But here is where I am getting stuck.

The book refers to using docker-machine to continue this process, to create the Digital Ocean instances, a docker-stack.yml file and then deploy.

But this looks to be out of date because reading the Docker documentation docker-machine has been superseded and is no longer the correct approach.

For the moment I would just like to make a very simple deploy to a droplet to see the site running and then be more ambitious with the scaling once it is working.

My question is—how can I achieve this?

I find lots of tutorials, and there is a great one on this site, for setting up Docker with Rails—but so far no clear explanation for taking that working application and then actually deploying it to Digital Ocean.

This seems like the best one online I’ve found, but is from 2016, and includes docker-machine as well.

My instinct is that I could set up the droplet with Docker pre-installed and then run docker-compose from the command line there, where it can pull the images from Docker Hub directly,… but in which case how would I share the docker-compose (or docker-stack) file?

I feel like I am missing an important piece of the puzzle and it has got me really stumped.

Any recommendations or just an explanation for the best way forward very much appreciated!

Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!