4f72261998
* Drop the obsolete top-level `version: "3.9"` key (Compose v2 ignores it with a warning). * Align `POSTGRES_DB` with the database name the bridge actually opens. main.go opens "whatsapp" unconditionally, so the previous "testdb" default makes the stack fail on first `docker compose up` with `pq: database "whatsapp" does not exist`. * Replace the public placeholder `API_KEY` / `JWT_SECRET` values with CHANGE_ME markers and an inline command for generating safe ones, so a user who copy-pastes the file can't accidentally bring up a bridge with publicly-known credentials. * Drop the hard-coded `WEBHOOK_URL` pointing at a private 192.168.x n8n instance and replace with a commented optional example. The env var is read with `os.Getenv`, so leaving it unset is supported.
50 lines
1.3 KiB
YAML
50 lines
1.3 KiB
YAML
services:
|
|
wa:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
container_name: wa
|
|
restart: always
|
|
environment:
|
|
IS_POSTGRES: "true"
|
|
POSTGRES_USER: "test"
|
|
POSTGRES_PASS: "test"
|
|
POSTGRES_HOST: "postgres"
|
|
POSTGRES_PORT: "5432"
|
|
# Replace with two strong, independent random strings before bringing the stack up.
|
|
# Suggested: openssl rand -base64 64 | tr -d '\n=' | tr '/+' '_-' | head -c 64
|
|
API_KEY: "CHANGE_ME_TO_A_LONG_RANDOM_STRING_AT_LEAST_64_CHARS_______________"
|
|
JWT_SECRET: "CHANGE_ME_TO_A_DIFFERENT_LONG_RANDOM_STRING_AT_LEAST_64_CHARS____"
|
|
# Optional: set this to forward every inbound message to a webhook (e.g. n8n).
|
|
# WEBHOOK_URL: "http://your-host:5678/webhook/whatsapp"
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- media:/project/store
|
|
depends_on:
|
|
- postgres
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
cpus: "1"
|
|
memory: "128M"
|
|
reservations:
|
|
cpus: "0.5"
|
|
memory: "64M"
|
|
postgres:
|
|
image: postgres:16
|
|
container_name: postgres
|
|
restart: always
|
|
environment:
|
|
POSTGRES_USER: "test"
|
|
POSTGRES_PASSWORD: "test"
|
|
POSTGRES_DB: "whatsapp"
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
|
|
volumes:
|
|
media:
|
|
pgdata:
|