version: '3.8'
services:
lark-bot:
build:
context: ..
dockerfile: bot/Dockerfile
container_name: lark-dashboard-bot
restart: unless-stopped
# Environment variables
env_file:
- .env
# Port mapping
ports:
- "${PORT:-3000}:3000"
# Volumes
volumes:
- ./logs:/app/logs:rw
# Resource limits
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
reservations:
cpus: '0.5'
memory: 256M
# Health check
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
# Logging
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Networks
networks:
- lark-bot-network
networks:
lark-bot-network:
driver: bridge