[For those who create portfolios] How to use binding.pry with Docker

While creating the portfolio, I was making it by referring to this article to deploy to Heroku using docker and CircleCI. I will tell you how to introduce it when you want to use binding.pry.

docker-compose.yml


version: '3'
services:
  db:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: root
    ports:
      - "4306:3306"

  web:
    build: .
    command: rails s -p 3000 -b '0.0.0.0'
    environment:
      RAILS_ENV: development
    volumes:
      - .:/sample_app #Set your own app directory name
    ports:
      - "3000:3000"
    links:
      - db

From the above state ① command: rails s -p 3000 -b Delete '0.0.0.0' ②tty: true

Click here for the final shape

docker-compose.yml



version: '3'
services:
  db:
    image: mysql:5.7
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: root
    ports:
      - "4306:3306"
  web:
    build: .
    environment:
      RAILS_ENV: development
    volumes:
      - .:/sample_app
    ports:
      - "3000:3000"
    links:
      - db
    tty: true

③docker-compose up ④docker-compose exec web bash ⑤rails s -p 3000 -b '0.0.0.0' ⑥ Insert binding.pry as you like

reference

https://qiita.com/gakinchoy7/items/ae31107ef56efb16fe7e https://stackoverflow.com/questions/35211638/how-to-debug-a-rails-app-in-docker-with-pry

Recommended Posts

[For those who create portfolios] How to use binding.pry with Docker
[For those who create portfolios] How to use font-awesome-rails
[For those who create portfolios] How to use chart kick
[For those who create portfolios] How to omit character strings
[For those who create portfolios] Search function created with ransack
How to use binding.pry for view files
How to build docker environment with Gradle for intelliJ
How to use binding.pry [53 days left]
How to start Camunda with Docker
How to use Mali Graphics Debugger to debug apps for Android (even those made with + Unity)
How to share files with Docker Toolbox
How to use BootStrap with Play Framework
[For those who create portfolios] Reduce mistakes and make the code easier to read -Rubocop Airbnb-
How to create a Maven repository for 2020
How to use Docker in VSCode DevContainer
[Ruby] How to use slice for beginners
Understand in 5 minutes !! How to use Docker
How to run Blazor (C #) with Docker
How to build Rails 6 environment with Docker
[Java] How to test for null with JUnit
How to create a database for H2 Database anywhere
How to use MyBatis2 (iBatis) with Spring Boot 1.4 (Spring 4)
How to use built-in h2db with spring boot
How to use an array for HashMap keys
A note for those who live with JMockit
How to use Java framework with AWS Lambda! ??
How to create multiple pull-down menus with ActiveHash
How to use Java API with lambda expression
How to give your image to someone with docker
How to use nfs protocol version 2 with ubuntu 18.04
How to create member variables with JPA Model
[Rails] How to build an environment with Docker
In the topic of "total concentration", "How to use Docker" is summarized for the virtual Mameko who sleeps in me.
How to build Docker + Springboot app (for basic learning)
How to use an array for a TreeMap key
How to use Map
How to use rbenv
How to use Oracle JDK 9 EA with Travis CI
How to use with_option
How to use fields_for
How to use java.util.logging
How to use map
For those who want to use MySQL for the database in the environment construction of Rails6 ~.
How to use Z3 library in Scala with Eclipse
How to use collection_select
[Spring Boot] How to create a project (for beginners)
Use Puphpeteer with Docker
How to use Twitter4J
How to use active_hash! !!
How to install Docker
How to use MapStruct
How to use Truth (assertion library for Java / Android)
How to delete untagged images in bulk with Docker
How to use identity
How to use hashes
How to create docker-compose
How to use JDD library in Scala with Eclipse
Try connecting to AzureCosmosDB Emulator for Docker with Java
How to use Dozer.mapper
How to use Gradle
How to use org.immutables