This commit is contained in:
Tour
2025-12-06 19:12:24 +01:00
parent 04f18ef2a8
commit b418912a1e
5 changed files with 149 additions and 781 deletions

66
docker-compose.yml Normal file
View File

@@ -0,0 +1,66 @@
services:
whatjs:
user: "1000:1000"
build:
context: .
dockerfile: Dockerfile
container_name: whatjs
restart: unless-stopped
networks:
- traefik_net
environment:
# Server configuration
- PORT=3000
- NODE_ENV=production
# API Security
- API_KEY=${API_KEY:-your-secure-api-key-here}
# Paths (pointing to volume mounts)
- DB_PATH=/app/data/whatsapp.db
- MEDIA_PATH=/app/media
# WhatsApp configuration
- HEADLESS=true
- REJECT_CALLS=false
# CORS configuration
- CORS_ORIGIN=*
volumes:
# Persistent data volumes
- whatsapp-data:/app/data
- whatsapp-media:/app/media
- whatsapp-cache:/app/.wwebjs_cache
- whatsapp-auth:/app/.wwebjs_auth
# Uncomment labels below when ready to use Traefik
# labels:
# - "traefik.enable=true"
# - "traefik.http.routers.whatjs.rule=Host(`whatjs.yourdomain.com`)"
# - "traefik.http.routers.whatjs.entrypoints=websecure"
# - "traefik.http.routers.whatjs.tls=true"
# - "traefik.http.routers.whatjs.tls.certresolver=letsencrypt"
# - "traefik.http.services.whatjs.loadbalancer.server.port=3000"
healthcheck:
test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/health', (r) => { process.exit(r.statusCode === 200 ? 0 : 1); }).on('error', () => process.exit(1));"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
networks:
traefik_net:
external: true
name: traefik_net
volumes:
whatsapp-data:
driver: local
whatsapp-media:
driver: local
whatsapp-cache:
driver: local
whatsapp-auth:
driver: local