| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- version: '3.8'
- services:
- backend:
- container_name: textskin-backend
- build:
- context: .
- dockerfile: Dockerfile
- restart: always
-
- # 端口映射:将容器的 8888 映射到宿主机的 8888
- # 绑定到 127.0.0.1 保证安全性,只允许宿主机的 Nginx 访问
- ports:
- - "127.0.0.1:8888:8888"
-
- # 加载 .env 文件中的变量
- env_file:
- - .env
- environment:
- - SEAWEEDFS_MASTER_URL=http://seaweedfs-master:9333
- - LOG_DIR=/app/logs
- # 持久化日志目录挂载
- volumes:
- - ./logs:/app/logs
- networks:
- - textskin-net # 加入同一个网络
- # 消息处理容器 (Iris)
- messenger:
- container_name: textskin-messenger
- build:
- context: .
- dockerfile: Dockerfile
- restart: always
- # 覆盖 Dockerfile 中的 CMD,执行消息推送脚本
- command: python3 scripts/iris.py
- env_file:
- - .env
- environment:
- - SEAWEEDFS_MASTER_URL=http://seaweedfs-master:9333
- - LOG_DIR=/app/logs
- # 持久化日志目录挂载
- volumes:
- - ./logs:/app/logs
- depends_on:
- - backend
- networks:
- - textskin-net
- networks:
- textskin-net:
- external: true
|