我有一个Ruby on Rails项目,我想将其放入容器中(有数据库,redis和web(包括rails项目)容器)。我想添加搜索功能,所以我在撰写文件中添加了一个狮身人面像容器
docker-compose.yml
web:
dockerfile: Dockerfile-rails
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
ports:
- "3000:3000"
links:
- redis
- db
**- sphinx**
environment:
- REDISTOGO_URL=redis://user@redis:6379/
redis:
image: redis
**sphinx:
image: centurylink/sphinx**
db:
dockerfile: Dockerfile-db
build: .
env_file: .env_db
docker-compose build
正常工作,但是当我运行docke-compose up
时,我得到了ERROR: Cannot start container 096410dafc86666dcf1ffd5f60ecc858760fb7a2b8f2352750f615957072d961: Cannot link to a non running container: /metartaf_sphinx_1 AS /metartaf_web_1/sphinx_1
我怎样才能解决这个问题 ?
最佳答案
根据https://hub.docker.com/r/centurylink/sphinx/的要求,Sphinx容器运行需要一些配置文件才能正常运行。请参阅*守护程序用法(2)。您需要数据源文件和配置。
在我的测试中,它无法按原样启动并出现错误:
FATAL: no readable config file (looked in /usr/local/etc/sphinx.conf, ./sphinx.conf)
https://stackoverflow.com/questions/35049550/