docker-compose.yml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. version: '3.8'
  2. services:
  3. backend:
  4. container_name: textskin-backend
  5. build:
  6. context: .
  7. dockerfile: Dockerfile
  8. restart: always
  9. # 端口映射:将容器的 8888 映射到宿主机的 8888
  10. # 绑定到 127.0.0.1 保证安全性,只允许宿主机的 Nginx 访问
  11. ports:
  12. - "127.0.0.1:8888:8888"
  13. # 加载 .env 文件中的变量
  14. env_file:
  15. - .env
  16. environment:
  17. - SEAWEEDFS_MASTER_URL=http://seaweedfs-master:9333
  18. - LOG_DIR=/app/logs
  19. # 持久化日志目录挂载
  20. volumes:
  21. - ./logs:/app/logs
  22. networks:
  23. - textskin-net # 加入同一个网络
  24. # 消息处理容器 (Iris)
  25. messenger:
  26. container_name: textskin-messenger
  27. build:
  28. context: .
  29. dockerfile: Dockerfile
  30. restart: always
  31. # 覆盖 Dockerfile 中的 CMD,执行消息推送脚本
  32. command: python3 scripts/iris.py
  33. env_file:
  34. - .env
  35. environment:
  36. - SEAWEEDFS_MASTER_URL=http://seaweedfs-master:9333
  37. - LOG_DIR=/app/logs
  38. # 持久化日志目录挂载
  39. volumes:
  40. - ./logs:/app/logs
  41. depends_on:
  42. - backend
  43. networks:
  44. - textskin-net
  45. networks:
  46. textskin-net:
  47. external: true