services: api: build: context: .. dockerfile: deploy/Dockerfile.api ports: - "8200:8080" volumes: - ../configs:/app/configs - ../sessions:/app/sessions environment: - GIN_MODE=release - TG_SECRET_KEY=${TG_SECRET_KEY} restart: unless-stopped healthcheck: test: ["CMD", "wget", "-q", "-O-", "http://localhost:8080/ping"] interval: 15s timeout: 5s retries: 3 start_period: 10s deploy: resources: limits: cpus: '2' memory: 1024M reservations: cpus: '0.5' memory: 256M networks: - spider_internal - external_db web: build: context: .. dockerfile: deploy/Dockerfile.web ports: - "8300:80" depends_on: api: condition: service_healthy restart: unless-stopped healthcheck: test: ["CMD", "wget", "--spider", "-q", "http://localhost:80/"] interval: 30s timeout: 5s retries: 3 deploy: resources: limits: cpus: '0.5' memory: 128M networks: - spider_internal networks: spider_internal: driver: bridge external_db: external: true name: chat_im_network # im_mysql + im_redis 所在的网络