-
-
Notifications
You must be signed in to change notification settings - Fork 402
Expand file tree
/
Copy pathdocker-compose-swarm.yaml
More file actions
86 lines (81 loc) · 2.63 KB
/
docker-compose-swarm.yaml
File metadata and controls
86 lines (81 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
version: "3.7"
services:
wuzapi-server:
image: asternic/wuzapi:latest
networks:
- network_public
environment:
- WUZAPI_ADMIN_TOKEN=${WUZAPI_ADMIN_TOKEN}
- DB_USER=${DB_USER:-wuzapi}
- DB_PASSWORD=${DB_PASSWORD:-wuzapi}
- DB_NAME=${DB_NAME:-wuzapi}
- DB_HOST=db
- DB_PORT=${DB_PORT:-5432}
- TZ=${TZ:-America/Sao_Paulo}
- WEBHOOK_FORMAT=${WEBHOOK_FORMAT:-json}
- SESSION_DEVICE_NAME=${SESSION_DEVICE_NAME:-WuzAPI}
# RabbitMQ configuration Optional
- RABBITMQ_URL=amqp://wuzapi:wuzapi@rabbitmq:5672/
- RABBITMQ_QUEUE=whatsapp_events
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints: [node.role == manager]
resources:
limits:
cpus: "1"
memory: 512MB
labels:
- traefik.enable=true
- traefik.http.routers.wuzapi-server.rule=Host(`api.wuzapi.app`)
- traefik.http.routers.wuzapi-server.entrypoints=websecure
- traefik.http.routers.wuzapi-server.priority=1
- traefik.http.routers.wuzapi-server.tls.certresolver=letsencryptresolver
- traefik.http.routers.wuzapi-server.service=wuzapi-server
- traefik.http.services.wuzapi-server.loadbalancer.server.port=${WUZAPI_PORT:-8080}
# healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:8080/health"]
# interval: 10s
# timeout: 5s
# retries: 3
# start_period: 10s
# RabbitMQ service OPTIONAL
rabbitmq:
image: rabbitmq:3-management
hostname: rabbitmq
networks:
- network_public
environment:
- RABBITMQ_DEFAULT_USER=wuzapi
- RABBITMQ_DEFAULT_PASS=wuzapi
- RABBITMQ_DEFAULT_VHOST=/
deploy:
mode: replicated
replicas: 1
restart_policy:
condition: on-failure
placement:
constraints: [node.role == manager]
resources:
limits:
cpus: "0.5"
memory: 256MB
labels:
- traefik.enable=true
- traefik.http.routers.rabbitmq-management.rule=Host(`rabbitmq.wuzapi.app`)
- traefik.http.routers.rabbitmq-management.entrypoints=websecure
- traefik.http.routers.rabbitmq-management.priority=1
- traefik.http.routers.rabbitmq-management.tls.certresolver=letsencryptresolver
- traefik.http.routers.rabbitmq-management.service=rabbitmq-management
- traefik.http.services.rabbitmq-management.loadbalancer.server.port=15672
volumes:
- rabbitmq_data:/var/lib/rabbitmq
volumes:
rabbitmq_data:
networks:
network_public:
name: network_public
external: true