forked from rmyndharis/OpenWA
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
88 lines (85 loc) · 3.01 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
88 lines (85 loc) · 3.01 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
87
88
# OpenWA - Local smoke / quick-start compose (L22)
#
# This builds and runs the PRODUCTION image (same Dockerfile) against a local SQLite DB
# with a bind-mounted ./data — it is a single-container local smoke test, NOT a
# hot-reload development environment (there is no source mount or `start:dev`).
# DATABASE_SYNCHRONIZE=true keeps the SQLite schema zero-config for local use; the
# production compose (docker-compose.yml) never forces synchronize (it defaults to false).
#
# Quick Start: docker compose -f docker-compose.dev.yml up -d
services:
# API Backend
openwa:
build:
context: .
dockerfile: Dockerfile
container_name: openwa-api
# Container hardening (finding H7) — same posture as production (same Dockerfile/entrypoint).
security_opt:
- 'no-new-privileges:true'
cap_drop:
- ALL
cap_add:
- CHOWN
- DAC_OVERRIDE
- FOWNER
- SETGID
- SETUID
read_only: true
tmpfs:
- /tmp
pids_limit: 512
mem_limit: ${OPENWA_MEM_LIMIT:-2g}
ports:
# Bind to localhost by default; set BIND_HOST=0.0.0.0 in .env to reach it from another host.
- '${BIND_HOST:-127.0.0.1}:2785:2785'
environment:
- NODE_ENV=development
- PORT=2785
- HOME=/tmp
# Chromium reads its home from the passwd entry (no /home/openwa), so it needs writable, existing
# config/cache dirs on the tmpfs or it hard-crashes at launch; the entrypoint pre-creates them. (#254)
- XDG_CONFIG_HOME=/tmp/.config
- XDG_CACHE_HOME=/tmp/.cache
- DATABASE_TYPE=sqlite
- DATABASE_NAME=/app/data/openwa.sqlite
- DATABASE_SYNCHRONIZE=true
- ENGINE_TYPE=whatsapp-web.js
- SESSION_DATA_PATH=/app/data/sessions
- PUPPETEER_HEADLESS=true
- PUPPETEER_ARGS=--no-sandbox,--disable-setuid-sandbox,--disable-dev-shm-usage,--disable-gpu
# Pin the WhatsApp Web version if a session hangs at "authenticating" after scanning the QR
# (whatsapp-web.js 1.34.x can stall on an incompatible auto-selected WA-Web version, #251/#273).
# Empty = auto-select (default). Set WWEBJS_WEB_VERSION in .env to a known-good version — see
# docs/12-troubleshooting-faq.md.
- WWEBJS_WEB_VERSION=${WWEBJS_WEB_VERSION:-}
- WWEBJS_WEB_VERSION_REMOTE_PATH=${WWEBJS_WEB_VERSION_REMOTE_PATH:-}
- STORAGE_TYPE=local
- STORAGE_LOCAL_PATH=/app/data/media
- WEBHOOK_TIMEOUT=10000
- WEBHOOK_MAX_RETRIES=3
- QUEUE_ENABLED=false
volumes:
- ./data:/app/data
restart: unless-stopped
healthcheck:
test: ['CMD', 'curl', '-f', 'http://localhost:2785/api/health/ready']
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
# Dashboard Frontend
dashboard:
build:
context: ./dashboard
dockerfile: Dockerfile
container_name: openwa-dashboard
ports:
- '${BIND_HOST:-127.0.0.1}:2886:80'
depends_on:
openwa:
condition: service_healthy
restart: unless-stopped
networks:
default:
name: openwa-network