docker-compose.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. services:
  2. postgres:
  3. image: postgres:16-alpine
  4. container_name: axonhub-postgres
  5. environment:
  6. POSTGRES_DB: axonhub
  7. POSTGRES_USER: axonhub
  8. POSTGRES_PASSWORD: ${DB_PASSWORD:-axonhub_password}
  9. volumes:
  10. - postgres_data:/var/lib/postgresql/data
  11. ports:
  12. - "5432:5432"
  13. networks:
  14. - axonhub-network
  15. restart: unless-stopped
  16. healthcheck:
  17. test: ["CMD-SHELL", "pg_isready -U axonhub"]
  18. interval: 10s
  19. timeout: 5s
  20. retries: 5
  21. axonhub:
  22. image: looplj/axonhub:latest
  23. container_name: axonhub-app
  24. environment:
  25. AXONHUB_DB_DIALECT: postgres
  26. AXONHUB_DB_DSN: postgres://axonhub:${DB_PASSWORD:-axonhub_password}@postgres:5432/axonhub?sslmode=disable
  27. ports:
  28. - "8090:8090"
  29. volumes:
  30. - ./config.yml:/app/config.yml:ro
  31. networks:
  32. - axonhub-network
  33. depends_on:
  34. postgres:
  35. condition: service_healthy
  36. restart: unless-stopped
  37. healthcheck:
  38. test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:8090/health"]
  39. interval: 30s
  40. timeout: 10s
  41. retries: 3
  42. start_period: 40s
  43. volumes:
  44. postgres_data:
  45. networks:
  46. axonhub-network:
  47. driver: bridge