Files
ChatRoom/docker-compose.yml
2026-02-04 14:52:59 +08:00

20 lines
745 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
version: '3.8'
services:
app:
build: . # 强制使用当前代码构建镜像
image: zhengdushi/chatroom:latest
container_name: chatroom-app
ports:
- "2779:2779"
environment:
- PORT=2779
# 使用 host.docker.internal 连接宿主机上的 RabbitMQ 和 Redis
- RABBITMQ_URL=amqp://admin:1218Zhengyaqi@host.docker.internal:5672/
- REDIS_ADDR=host.docker.internal:6379
# 移除 depends_on因为依赖的是外部服务
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway" # 确保 Linux 环境下也能解析(虽然 Windows 通常自带,加上更保险)
# 移除 RabbitMQ 和 Redis 服务定义,直接使用外部容器