2
3

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-composeでexit status 1

Last updated at Posted at 2019-12-18

#はじめに
macOS Mojave 10.14.6
Docker 2.1.0.5

#とりあえず

$ docker-compose up
...
front_nuxt  | npm ERR! Exit status 1
front_nuxt  | npm ERR! 
front_nuxt  | npm ERR! Failed at the Musclers@1.0.0 dev script.
front_nuxt  | npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
front_nuxt  | 
front_nuxt  | npm ERR! A complete log of this run can be found in:
front_nuxt  | npm ERR!     /root/.npm/_logs/2019-12-18T01_41_30_431Z-debug.log
front_nuxt  | front_nuxt exited with code 1

といってフロントくん(nuxt)が起動しない

$ docker-compose ps
   Name                 Command               State           Ports         
----------------------------------------------------------------------------
api_rails    bash -c rm -f 'tmp/pids/se ...   Up      0.0.0.0:8080->8080/tcp
db_psql      docker-entrypoint.sh postgres    Up      5432/tcp              
front_nuxt   docker-entrypoint.sh npm r ...   Exit 1      0.0.0.0:3000->3000/tcp

まぁ、だよね

#原因
これがイマイチわからない。

#やったこと
pruneでimageを一括削除した。

$ docker-compose down
$ docker system prune --volumes
# docker system pruneではvolumeまで削除してくれない
$ docker-compose up --build
# build忘れないようにね

で、buildが終わった後、無事起動しました。

#最後に
最後にって書く必要あるのかわからないけどrailsとか使ってるなら、
db:createmigratedb:seed忘れないようにね。
DB空っぽだから何もできずに発狂した人もいるらしい←

2
3
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
2
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?