docker-compose.yml 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. services:
  2. app:
  3. container_name: torqvoice
  4. image: ghcr.io/torqvoice/torqvoice:latest
  5. restart: unless-stopped
  6. ports:
  7. - "3000:3000"
  8. environment:
  9. - DATABASE_URL=postgresql://torqvoice:${POSTGRES_PASSWORD:-torqvoice}@db:5432/torqvoice
  10. - BETTER_AUTH_SECRET=${BETTER_AUTH_SECRET}
  11. - NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL:-http://localhost:3000}
  12. - RESEND_API_KEY=${RESEND_API_KEY:-}
  13. - RESEND_FROM_EMAIL=${RESEND_FROM_EMAIL:-}
  14. # Optional, see .env.example: the largest backup data file a restore reads
  15. # into memory, in MiB (128 unless set).
  16. - BACKUP_MAX_DATA_FILE_MB=${BACKUP_MAX_DATA_FILE_MB:-}
  17. volumes:
  18. - uploads:/app/data/uploads
  19. - backups:/app/data/backups
  20. depends_on:
  21. db:
  22. condition: service_healthy
  23. db:
  24. image: postgres:16-alpine
  25. container_name: torqvoice-db
  26. restart: unless-stopped
  27. volumes:
  28. - postgres-data:/var/lib/postgresql/data
  29. environment:
  30. POSTGRES_USER: torqvoice
  31. # Set POSTGRES_PASSWORD in .env before the first start. The same value
  32. # goes into the app's DATABASE_URL above as it is, with no escaping, so
  33. # keep it to letters and digits (`openssl rand -hex 24`): a `/`, `@`, `#`
  34. # or `%` in it breaks the URL. Postgres keeps the password it was
  35. # created with, so changing it later means changing it in the database
  36. # as well (ALTER USER torqvoice PASSWORD '...').
  37. POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-torqvoice}
  38. POSTGRES_DB: torqvoice
  39. ports:
  40. # The app reaches the database as `db` on Docker's own network; this is
  41. # for psql or a GUI on the host only. Bound to loopback because Docker
  42. # publishes ports past the host firewall, and 0.0.0.0 put the database
  43. # on the internet with the password above.
  44. - "127.0.0.1:5432:5432"
  45. healthcheck:
  46. test: ["CMD-SHELL", "pg_isready -U torqvoice"]
  47. interval: 5s
  48. timeout: 5s
  49. retries: 5
  50. volumes:
  51. postgres-data:
  52. uploads:
  53. backups: