0
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.

docker-compose up時にwebpack-dev-serverが起動されるようにする

0
Posted at

はじめに

railsのフロントエンドにwebpackerを使っているとwebpack-dev-serverを使った方がコンパイルに使う時間を短縮できます。
環境構築にdockerを使っていると仮定してdockre-compsoe up時にwebpack-dev-serverも起動されるように設定ファイルを編集します。

環境

rails 6.1.6
ruby 3.0.6
webpacker 5.4.3

docker-compose.yml

railsが動いているコンテナのcommandで下記のように指定します。

command: bash -c "rm -f tmp/pids/server.pid && ./bin/webpack-dev-server & bundle exec rails s -b '0.0.0.0'"
0
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
0
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?