Deploy to heroku with Docker (Rails 6, MySQL)

1 Prerequisites

1 Credit card registered heroku account 2 Rails application created in docker environment (Add RUN apt-get install -y vim to Dockerfile when editing credentials: edit) * Refer to this article https://qiita.com/croquette0212/items/44378e01de18f62d01df 3 heroku cli installed

2 Describe the following in config / environments / development.rb

Rails.application.confiture do
(Abbreviation)
config.hosts.clear
(Abbreviation)
end 

3 Delete container & server.pid

$ docker-compose stop
$ rm -f tmp/pids/server.pid

4 heroku ready

$cd directory name
$ heroku login --interactive
$ heroku container:login 
$heroku create app name

5 Change heroku database settings to MySQL

$ heroku addons:add cleardb
$ heroku config:set DATABASE_URL=`heroku config:get CLEARDB_DATABASE_URL | sed -- s/mysql/mysql2/`

6 Deploy to heroku

$ heroku container:push web
$ heroku container:release web
$ heroku run rails db:migrate
$ heroku open

Recommended Posts

Deploy to heroku with Docker (Rails 6, MySQL)
Deploy Rails on Docker to heroku
Rails deploy with Docker
Deploy heroku with Rails6 (Cloud9 + Ubuntu) + MySQL
Error deploying rails5 + Mysql to heroku with Docker-compose
Deploy Line bot with rails5 + Docker + Heroku Note
Rails + MySQL environment construction with Docker
[Environment construction with Docker] Rails 6 & MySQL 8
Update MySQL from 5.7 to 8.0 with Docker
heroku: docker: deploy
[Rails] How to use rails console with docker
Deploy to Heroku [Ruby on Rails] Beginner
How to build Rails 6 environment with Docker
How to build Rails + Vue + MySQL environment with Docker [2020/09 latest version]
I was able to deploy the Docker + laravel + MySQL app to Heroku!
Steps to deploy to Heroku
[Docker] Connection with MySQL
[Rails] Development with MySQL
Rails6 [API mode] + MySQL5.7 environment construction with Docker
Deploy Rails to ECS Fargate with AWS Copilot
[Rails MySQL] How to reset DB on heroku
[Rails] How to build an environment with Docker
Easy to display hello world with Rails + Docker
How to make batch processing with Rails + Heroku configuration
Deploy Vapor Project to Heroku
Deploy with EC2 / Docker / Laravel
How to deploy to Heroku from a local docker image
How to deploy on heroku
Run Rails whenever with docker
Connect to MySQL 8 with Java
[Docker] Rails 5.2 environment construction with docker
Build Rails (API) x MySQL x Nuxt.js environment with Docker
[Docker + Rails] How to deal with Rails server startup failure
[Docker] Use whenever with Docker + Rails
[Rails AWS Docker] Build an existing Ruby on Rails + MySQL application with Docker and deploy it on AWS (5)
[Rails AWS Docker] Build an existing Ruby on Rails + MySQL application with Docker and deploy it on AWS (6)
[Rails AWS Docker] Build an existing Ruby on Rails + MySQL application with Docker and deploy it on AWS (3)
[Rails AWS Docker] Build an existing Ruby on Rails + MySQL application with Docker and deploy it on AWS (2)
[Rails AWS Docker] Build an existing Ruby on Rails + MySQL application with Docker and deploy it on AWS (1)
[Rails AWS Docker] Build an existing Ruby on Rails + MySQL application with Docker and deploy it on AWS (4)
I tried to make an introduction to PHP + MySQL with Docker
How to build [TypeScript + Vue + Express + MySQL] environment with Docker ~ Express ~
Rails application development environment construction with Docker [Docker, Rails, Puma, Nginx, MySQL]
How to build Rails, Postgres, ElasticSearch development environment with Docker
How to use mysql with M1 mac Docker preview version
docker-compose.yml when you want to keep mysql running with docker
How to deploy jQuery on Rails
Deploy a Docker application with Greengrass
Rails new fails to install mysql
How to deploy Bootstrap on Rails
Build environment with vue.js + rails + docker
Read dump file with Docker MySQL
mysql2 fails to install with bundle install
Build Rails environment with Docker Compose
Deploy to EC2 with CircleCi + Capistrano
Deploy Flask's Docker image on Heroku
Connect to Rails server with iPhone
How to get along with Rails
mysql doesn't start up with docker.
Introducing React to Rails with react-rails
Rails DB PostgreSQL changed to MySQL