π³ Docker Compose β Production Stack
Ship wacraftβserver, PostgreSQL, and the Angular UI on a single VM with
docker compose up -d. Perfect for side projects, PoCs, SMEs, or anyone who
wants HTTPS and persistence without managing Kubernetes.
Footprint: <300 MB RAM when idle, <200 MB compressed image pull.
π§° Prerequisites
| What | Minimum | Notes |
|---|---|---|
| Docker Engine | 24 + | Linux, macOS, or Windows Server 2022 / WSL2. |
| Docker Compose | v2 (builtβin) | Use the native docker compose CLI. |
| DNS records | api.example.com, app.example.com |
Point A/CNAME to the VM or LB. |
| TLS cert | Let's Encrypt or managed LB | Terminate HTTPS before traffic reaches the container. |
| CPU + RAM | 2 vCPUs / 2 GB min (4 GB sweetβspot) | UI builds at first boot; RAM spikes to β1.2 GB for 2β3 min. |
1 β Bootstrap .env
cp compose.env .env # template ships in the repo
nano .env # or your favourite editor
Fill only these placeholders β the compose file injects the rest.
# βββββββββββ Runtime βββββββββββ
SU_PASSWORD=change_me_safely
JWT_SECRET=$(openssl rand -hex 32)
AUTH_TOKEN= # optional service-to-service token
# βββββββββββ Registration βββββββββββ
ALLOW_REGISTRATION=false # disable after your team accounts are created
REQUIRE_EMAIL_VERIFICATION=true
# βββββββββββ Email (SMTP) βββββββββββ
SMTP_HOST=smtp.example.com
SMTP_PORT=587
SMTP_USER=apikey
SMTP_PASSWORD=your_smtp_password
SMTP_FROM=noreply@example.com
APP_BASE_URL=https://app.example.com
# βββββββββββ Firewall (optional) βββββββββββ
# IP_DENYLIST=198.51.100.0/24
RATE_LIMIT_ENABLED=true
# βββββββββββ Frontend (Angular UI) βββββββββββ
APP_TITLE="wacraft"
MAIN_SERVER_URL=api.example.com
MAIN_SERVER_SECURITY=true # true = HTTPS, false = plain HTTP
GOOGLE_MAPS_API_KEY=
WEBSOCKET_BASE_PING_INTERVAL=
# βββββββββββ Billing (optional) βββββββββββ
# BILLING_ENABLED=true
# STRIPE_SECRET_KEY=sk_live_...
# STRIPE_WEBHOOK_SECRET=whsec_...
π Reference docs: β’ Environment Variables β’ Firewall & Rate Limiting β’ Stripe / Billing Setup
WhatsApp credentials are configured through the UI after first login β not in
.env. See Phone Config Guide.
2 β Clone & Launch
git clone https://github.com/Astervia/wacraft.git && cd wacraft
docker compose up -d
What's inside docker-compose.yml?
| Service | Notes |
|---|---|
| server | Go static binary, port 6900. |
| client | Angular UI served by Nginx (compiled on first boot). |
| db | postgres:16βalpine with a named volume wacraft_db_data. |
3 β First signβin & setup
URL : https://app.example.com
Login : su@sudo
Pass : <value_of_SU_PASSWORD>
After login:
- Create a workspace.
- Navigate to Phone Configs β New and enter your Meta credentials.
- Register the Meta webhook β see Webhook Setup.
4 β Operational commands
| Action | Command |
|---|---|
| Tail everything | docker compose logs -f |
| Follow only server logs | docker compose logs -f server |
| Live reload after env change | docker compose up -d --force-recreate |
| Enter psql shell | docker compose exec db psql -U postgres |
| Dump DB | docker compose exec db pg_dump -U postgres postgres > backup.sql |
| Stop stack (persist volumes) | docker compose down |
| Nuke all data (β οΈ prod!) | docker compose down -v |
5 β Upgrades
git pullto fetch the latest tags.docker compose pull && docker compose up -d
Optionally add containrrr/watchtower to autoβupdate images weekly.
6 β Hardening checklist
- VM firewalls allow 80/443 from the internet and 80/443/6900 from the VPC.
- Set
ALLOW_REGISTRATION=falseonce all accounts are created. - Configure SMTP so users can verify email and reset passwords.
- Review Firewall & Rate Limiting β set
IP_DENYLISTif needed. - Rotate
JWT_SECRETannually. - Point
DATABASE_URLto managed RDS if you need multi-AZ HA. - Snapshot
wacraft_db_datanightly (cron or provider snapshot). - Configure an uptime monitor on
/healthz(server) and/(client). - Verify Meta webhook URL is
https://api.example.com/webhook-in. - If billing enabled: Stripe keys are live keys and webhook is registered.
7 β Next steps
- Check the UI Walkthrough to get familiar with the UI.
- Learn about Workspaces & Permissions.
- Set up Billing if you want throughput plans.
Happy shipping π