docker-compose.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. services:
  2. postgres:
  3. image: docker.m.daocloud.io/library/postgres:16-alpine
  4. container_name: celestia-postgres
  5. restart: unless-stopped
  6. environment:
  7. POSTGRES_USER: ${DB_USER:-celestia}
  8. POSTGRES_PASSWORD: ${DB_PASSWORD:-celestia_secret}
  9. POSTGRES_DB: ${DB_NAME:-celestia_trace}
  10. volumes:
  11. - pgdata:/var/lib/postgresql/data
  12. ports:
  13. - "5433:5432"
  14. healthcheck:
  15. test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-celestia} -d ${DB_NAME:-celestia_trace}"]
  16. interval: 5s
  17. timeout: 5s
  18. retries: 5
  19. backend:
  20. build: .
  21. container_name: celestia-backend
  22. restart: unless-stopped
  23. depends_on:
  24. postgres:
  25. condition: service_healthy
  26. environment:
  27. DB_HOST: postgres
  28. DB_PORT: 5432
  29. DB_USER: ${DB_USER:-celestia}
  30. DB_PASSWORD: ${DB_PASSWORD:-celestia_secret}
  31. DB_NAME: ${DB_NAME:-celestia_trace}
  32. JWT_SECRET: ${JWT_SECRET:-change-me-in-production}
  33. SERVER_PORT: 8080
  34. GIN_MODE: release
  35. ports:
  36. - "8080:8080"
  37. volumes:
  38. pgdata: