我需要在www服务中设置Internet连接,并且还要维护服务发现。当我将dns值添加到www时,自动发现会中断,然后服务无法使用服务名称找到彼此。这是我的docker-compose.yml:
version: '3.3'
services:
www:
build: ./
ports:
- "80:80"
links:
- db
- redis_service
depends_on:
- db
- redis_service
db:
build: db/.
volumes:
- /var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: ****
MYSQL_DATABASE: *****
redis_service:
restart: always
image: redis:latest
ports:
- "6379:6379"
volumes:
- redis_data:/data
celery:
build: .
command: bash -c "cd ./app && celery -A main worker -l info"
volumes:
- '.:/app'
volumes:
redis_data: