1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Docker+RubyonRails でよく使うコマンドメモ

Posted at

アプリを作成するときはDockerを利用するのですが、Railsコマンド打つとき最初よく分からなくて躓いてたんで自分用メモとして記します。

#gemのインストール

docker-compose build --no-cache

Docker-compose downしてから行ってください。

#dockerでrailsコマンドを打つ

docker-compose run --rm web rails

#Dockerfileやdocker-compose.ymlの変更を反映、railsサーバーを再起動

docker-compose up --build

#MySQL

docker-compose exec db mysql -u root -p

Mysqlは「database.yml」で指定したパスワードで中身を見ることができます。

#まとめ
よくこの辺を使うので参考になればと思います。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?