docker-compose.yml.template 1.2 KB

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