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 1 year has passed since last update.

【Rails】docker-compose 基本コマンド

Last updated at Posted at 2022-06-16

railsコマンド

モデル作成
docker-compose run web bundle exec rails g model モデル名 カラム 

モデルは単数系で頭文字は大文字٩( 'ω' )و

マイグレーション
docker-compose run web bundle exec rails db:migrate
コントローラー作成
docker-compose run web bundle exec rails g controller posts new

その他

build時にキャッシュを使わない

下記コマンドは変更内容が反映されない時に使います

docker-compose build --no-cache
dockeの中に入る

dockerのコンテナ名は docker psで確認!

docker-compose exec #{container} bash 
Gem一覧確認コマンド
docker-compose run web ls /usr/local/bundle/gems

rubcop実行

docker-compose run web bundle exec rubocop --require rubocop-airbnb
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?