docker-compose.yml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. services:
  2. api:
  3. build:
  4. context: ..
  5. dockerfile: deploy/Dockerfile.api
  6. ports:
  7. - "8200:8080"
  8. volumes:
  9. - ../configs:/app/configs
  10. - ../sessions:/app/sessions
  11. environment:
  12. - GIN_MODE=release
  13. - TG_SECRET_KEY=${TG_SECRET_KEY}
  14. restart: unless-stopped
  15. healthcheck:
  16. test: ["CMD", "wget", "-q", "-O-", "http://localhost:8080/ping"]
  17. interval: 15s
  18. timeout: 5s
  19. retries: 3
  20. start_period: 10s
  21. deploy:
  22. resources:
  23. limits:
  24. cpus: '2'
  25. memory: 1024M
  26. reservations:
  27. cpus: '0.5'
  28. memory: 256M
  29. networks:
  30. - spider_internal
  31. - external_db
  32. web:
  33. build:
  34. context: ..
  35. dockerfile: deploy/Dockerfile.web
  36. ports:
  37. - "8300:80"
  38. depends_on:
  39. api:
  40. condition: service_healthy
  41. restart: unless-stopped
  42. healthcheck:
  43. test: ["CMD", "wget", "--spider", "-q", "http://localhost:80/"]
  44. interval: 30s
  45. timeout: 5s
  46. retries: 3
  47. deploy:
  48. resources:
  49. limits:
  50. cpus: '0.5'
  51. memory: 128M
  52. networks:
  53. - spider_internal
  54. networks:
  55. spider_internal:
  56. driver: bridge
  57. external_db:
  58. external: true
  59. name: chat_im_network # im_mysql + im_redis 所在的网络