docker-compose.yml 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. # Optional, see .env.example: error, warn, info (the default) or debug.
  18. - LOG_LEVEL=${LOG_LEVEL:-}
  19. volumes:
  20. - uploads:/app/data/uploads
  21. - backups:/app/data/backups
  22. depends_on:
  23. db:
  24. condition: service_healthy
  25. db:
  26. image: postgres:16-alpine
  27. container_name: torqvoice-db
  28. restart: unless-stopped
  29. volumes:
  30. - postgres-data:/var/lib/postgresql/data
  31. environment:
  32. POSTGRES_USER: torqvoice
  33. # Set POSTGRES_PASSWORD in .env before the first start. The same value
  34. # goes into the app's DATABASE_URL above as it is, with no escaping, so
  35. # keep it to letters and digits (`openssl rand -hex 24`): a `/`, `@`, `#`
  36. # or `%` in it breaks the URL. Postgres keeps the password it was
  37. # created with, so changing it later means changing it in the database
  38. # as well (ALTER USER torqvoice PASSWORD '...').
  39. POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-torqvoice}
  40. POSTGRES_DB: torqvoice
  41. ports:
  42. # The app reaches the database as `db` on Docker's own network; this is
  43. # for psql or a GUI on the host only. Bound to loopback because Docker
  44. # publishes ports past the host firewall, and 0.0.0.0 put the database
  45. # on the internet with the password above.
  46. - "127.0.0.1:5432:5432"
  47. healthcheck:
  48. test: ["CMD-SHELL", "pg_isready -U torqvoice"]
  49. interval: 5s
  50. timeout: 5s
  51. retries: 5
  52. volumes:
  53. postgres-data:
  54. uploads:
  55. backups: