Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Rails in docker

184 visualizaciones

Publicado el

Dockerizing a rails app and developing in it.

Start with an existing rails app (or rails new), build an image, start it, make and see changes to your running app

Publicado en: Tecnología
  • Sé el primero en comentar

Rails in docker

  1. 1. Rails in Docker Dockerizing and developing Andrew Klotz @klotzandrew
  2. 2. What is docker? - Package code, with environment, and dependencies - Docker images - Containers run images
  3. 3. What you need to install ● docker ● docker-compose ● docker-machine ● https://docs.docker.com/docker-for-mac
  4. 4. docker-machine ● eval $(docker-machine env default) ● docker-machine ls
  5. 5. Dockerized rails Ruby container ● Ruby ● Build ourselves Database container ● PostgreSQL ● Use official image
  6. 6. Docker image for rails ● Rails new or existing app ● Add a Dockerfile (touch Dockerfile)
  7. 7. ● Connect to containerized db in config/database.yml
  8. 8. Database ● official postgres image ● docker run --name db postgres ● docker ps
  9. 9. Docker orchestration - vim docker-compose.yml - docker-compose up
  10. 10. Check it out! ● visit (docker-machine ip):3000 ● docker ps ● see live code changes in the container ● run commands with a container ○ docker exec -it dockerrails_web_1 rails test ○ docker exec -it dockerrails_web_1 bash
  11. 11. Recap ● vim Dockerfile ● vim database.yml ● vim docker-compose.yml ● docker-compose up

×