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.

VSCodeのRemote - Containersを使ってdocker-composeしてRailsのサーバーを立ち上げた時、なぜかサーバーが起動していない現象

Posted at

はじめに

Railsの初学者が書いています。
間違ってたり、こうした方がいいなどがあれば教えてください

僕はこれで1日を無駄にしました。
皆さんはちゃんと英語を読むようにしましょう(戒め)

結論

以下のように変更しましょう

/.devcontainer/docker-compose.yml
...

# Overrides default command so things don't shut down after the process ends.
- command: /bin/sh -c "while sleep 1000; do :; done"
+ command: /bin/sh -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'; while sleep 1000; do :; done"

原因

上のコメントにあるようにOverridesされます。
そのため元のdocker-composeのCOMMANDが実行されません。

参考

【Rails】Rails 6.0 x Docker x MySQLで環境構築
VSCode Remote Containerが良い

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?