Trying to deploy a rails application in a cloud provider ie dreamhost, that uses OpenStack these are the steps needed:
- Install docker in your development machine and your cloud provider by following the installation instructions from here
- Create an account in Docker Hub, that will be needed later on to push your docker image with the application
- Pull the official rails docker image to your development environment:
1sudo docker pull rails:latest
- Create a new simple rails application:
1rails new docker_test
- Change to the application directory and add a Dockerfile in the root directory containing the following:
1FROM rails:onbuild
- Build your new image by using:
1sudo docker build -t rails_docker_test .
- Check that your image was build by using:
1sudo docker images
- Start the container with:
1sudo docker run --name rails_test -p 0.0.0.0:3000:3000 -d rails_docker_test
- Make sure that you can see the initial rails page by using your browser to go to http://127.0.0.1:3000
- Push your image to your Docker Hub account by first logging in to it from the command line:
1sudo docker login --username=yourhubusername --email=youremail@company.com1sudo docker push yourhubusername/rails_docker_test
- TBC