docker-compose.postgres.yaml 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Docker Compose configuration for CDK Mint with PostgreSQL
  2. # Usage: docker-compose -f docker-compose.postgres.yaml up
  3. services:
  4. # CDK Mint service with PostgreSQL
  5. mintd:
  6. build:
  7. context: .
  8. dockerfile: Dockerfile
  9. container_name: mint
  10. ports:
  11. - "8085:8085"
  12. environment:
  13. - CDK_MINTD_URL=https://example.com
  14. - CDK_MINTD_LN_BACKEND=fakewallet
  15. - CDK_MINTD_LISTEN_HOST=0.0.0.0
  16. - CDK_MINTD_LISTEN_PORT=8085
  17. - CDK_MINTD_MNEMONIC=
  18. # PostgreSQL database configuration
  19. - CDK_MINTD_DATABASE=postgres
  20. - CDK_MINTD_DATABASE_URL=postgresql://cdk_user:cdk_password@postgres:5432/cdk_mint
  21. # Cache configuration
  22. - CDK_MINTD_CACHE_BACKEND=memory
  23. command: ["cdk-mintd"]
  24. depends_on:
  25. postgres:
  26. condition: service_healthy
  27. # PostgreSQL database service
  28. postgres:
  29. image: postgres:16-alpine
  30. container_name: mint_postgres
  31. restart: unless-stopped
  32. environment:
  33. - POSTGRES_USER=cdk_user
  34. - POSTGRES_PASSWORD=cdk_password
  35. - POSTGRES_DB=cdk_mint
  36. - POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C
  37. ports:
  38. - "5432:5432"
  39. volumes:
  40. - postgres_data:/var/lib/postgresql/data
  41. healthcheck:
  42. test: ["CMD-SHELL", "pg_isready -U cdk_user -d cdk_mint"]
  43. interval: 10s
  44. timeout: 5s
  45. retries: 5
  46. start_period: 30s
  47. volumes:
  48. postgres_data:
  49. driver: local