docker-compose.yml.template 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. version: '3.9'
  2. services:
  3. redis-kv:
  4. image: redis:latest
  5. networks:
  6. - srht-net
  7. database:
  8. image: postgres:latest
  9. volumes:
  10. - db-data:/var/lib/postgresql/data
  11. - ./postgres_sh:/docker-entrypoint-initdb.d
  12. environment:
  13. POSTGRES_USER: sourcehut
  14. POSTGRES_PASSWORD: sourcehut
  15. POSTGRES_MULTIPLE_DATABASES: metasrht,{{database_name}}
  16. networks:
  17. - srht-net
  18. healthcheck:
  19. test: ["CMD", "pg_isready", "-U", "metasrht"]
  20. interval: 10s
  21. timeout: 5s
  22. retries: 3
  23. srhts:
  24. build: ./
  25. volumes:
  26. - git-data:/var/lib/git
  27. - ./config.ini:/etc/sr.ht/config.ini
  28. - static-data:/usr/lib/python3.9/site-packages/
  29. networks:
  30. - srht-net
  31. depends_on:
  32. database:
  33. condition: service_healthy
  34. nginx:
  35. image: nginx:alpine
  36. ports:
  37. - '80:80'
  38. volumes:
  39. - ./nginx_conf/:/etc/nginx/
  40. - static-data:/usr/lib/python3.9/site-packages/
  41. networks:
  42. - srht-net
  43. depends_on:
  44. - srhts
  45. volumes:
  46. db-data:
  47. git-data:
  48. static-data:
  49. networks:
  50. srht-net:
  51. driver: bridge