Edit docker-compose.

This commit is contained in:
元皓yh 2025-05-10 11:30:27 +08:00 committed by GitHub
parent 69db408fe2
commit 92a0358744
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,15 +1,29 @@
version: '3.8'
services: services:
newsanalyze-service: internal-proxy:
build: . image: traefik:latest
command:
- --entrypoints.webinternal.address=:80
ports: ports:
- "127.0.0.1:36694:3000" - "127.0.0.1:36694:80"
environment: volumes:
- NODE_ENV=production - /var/run/docker.sock:/var/run/docker.sock:ro
restart: unless-stopped networks:
- app-network
newsanalyze-service:
build: .
healthcheck: healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3000"] test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
interval: 30s interval: 1m
timeout: 10s timeout: 10s
retries: 3 retries: 3
networks:
- app-network
labels:
- "traefik.enable=true"
- "traefik.http.routers.newsanalyze.rule=Host(`news.yuanhau.com`)"
- "traefik.http.routers.newsanalyze.entrypoints=webinternal"
- "traefik.http.services.newsanalyze.loadbalancer.server.port=3000"
networks:
app-network:
driver: bridge