docker-compose.yaml 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. {% from "rsync_macros/rsyncd.conf" import rsyncd_conf %}
  2. {% set tpl = ix_lib.base.render.Render(values) %}
  3. {% set c1 = tpl.add_container(values.consts.rsyncd_container_name, "image") %}
  4. {% do c1.set_user(0, 0) %}
  5. {% do c1.add_caps(["CHOWN", "DAC_OVERRIDE", "FOWNER", "SETUID", "SETGID", "SYS_CHROOT", "SETFCAP"]) %}
  6. {% do c1.healthcheck.set_custom_test("pgrep rsync") %}
  7. {% do c1.environment.add_user_envs(values.rsyncd.additional_envs) %}
  8. {% do c1.configs.add("rsyncd.conf", rsyncd_conf(values, tpl), values.consts.rsync_conf_path) %}
  9. {% do c1.add_port(values.network.rsync_port) %}
  10. {% for mod in values.rsyncd.rsync_modules if mod.enabled %}
  11. {% set mount_path = "%s/%s"|format(values.consts.module_base_path, mod.name) %}
  12. {% set store_cfg = {
  13. "type": "host_path",
  14. "mount_path": mount_path,
  15. "host_path_config": {
  16. "path": mod.host_path,
  17. "create_host_path": mod.get("create_host_path", false),
  18. },
  19. } %}
  20. {% do c1.add_storage(mount_path, store_cfg) %}
  21. {% endfor %}
  22. {% for store in values.storage.additional_storage %}
  23. {% do c1.add_storage(store.mount_path, store) %}
  24. {% endfor %}
  25. {{ tpl.render() | tojson }}