1
0

docker-compose.yml.template 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. - mercurial-data:/var/lib/mercurial
  28. - ./config.ini:/etc/sr.ht/config.ini
  29. - ./srht.priv:/etc/sr.ht/srht.priv
  30. - ./srht.pub:/etc/sr.ht/srht.pub
  31. - static-data:/usr/lib/python3.9/site-packages/
  32. networks:
  33. - srht-net
  34. depends_on:
  35. database:
  36. condition: service_healthy
  37. nginx:
  38. image: nginx:alpine
  39. ports:
  40. - '80:80'
  41. volumes:
  42. - ./nginx_conf/:/etc/nginx/
  43. - static-data:/usr/lib/python3.9/site-packages/
  44. networks:
  45. - srht-net
  46. depends_on:
  47. - srhts
  48. volumes:
  49. db-data:
  50. git-data:
  51. mercurial-data:
  52. static-data:
  53. networks:
  54. srht-net:
  55. driver: bridge
  56. ipam:
  57. config:
  58. - subnet: 172.28.0.0/16