我想使用Docker部署rails项目.所以我用Docker作曲.但我收到一条奇怪的错误信息.当运行docker compose up(包含带有postgresql的db容器、redis和带有rails的web容器)时,我得到一个
web_1 | => Booting Puma
web_1 | => Rails 4.2.4 application starting in production on http://0.0.0.0:3000
web_1 | => Run
rails服务器-hfor more startup options
web_1 | => Ctrl-C to shutdown server
web_1 | A server is already running. Check /usr/src/app/tmp/pids/server.pid.
web_1 | Exiting
我的docker .yml文件
web:
dockerfile: Dockerfile导轨
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
ports:
- "80:3000"
links:
- redis
- db
environment:
- REDISTOGO_URL=redis://user@redis:6379/
redis:
image: redis
db:
dockerfile: Dockerfile-db
build: .
env_file: .env_db
Dockerfile导轨
FROM rails:onbuild
ENV RAILS_ENV=production
我不认为我需要发布所有的文件
UPD:我自己修复了它:我只是删除了所有的容器,然后再次运行docker-compose up