docker-compose.test.yml 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. version: '3'
  2. services:
  3. postgres:
  4. image: postgres:15-alpine
  5. container_name: gogs-test-postgres
  6. restart: unless-stopped
  7. environment:
  8. POSTGRES_USER: gogs
  9. POSTGRES_PASSWORD: gogs
  10. POSTGRES_DB: gogs
  11. volumes:
  12. - postgres-data:/var/lib/postgresql/data
  13. networks:
  14. - gogs-test
  15. healthcheck:
  16. test: ["CMD-SHELL", "pg_isready -U gogs"]
  17. interval: 10s
  18. timeout: 5s
  19. retries: 5
  20. gogs:
  21. build:
  22. context: .
  23. dockerfile: Dockerfile
  24. container_name: gogs-test
  25. restart: unless-stopped
  26. ports:
  27. - "10022:22"
  28. - "10080:3000"
  29. volumes:
  30. - gogs-data:/data
  31. - ./custom:/data/gogs
  32. depends_on:
  33. postgres:
  34. condition: service_healthy
  35. networks:
  36. - gogs-test
  37. environment:
  38. - SOCAT_LINK=false
  39. healthcheck:
  40. test: ["CMD", "curl", "-f", "http://localhost:3000/healthcheck"]
  41. interval: 30s
  42. timeout: 10s
  43. retries: 3
  44. start_period: 60s
  45. networks:
  46. gogs-test:
  47. driver: bridge
  48. volumes:
  49. postgres-data:
  50. gogs-data: