Matrix Docker Ansible eploy
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 

41 rader
1.4 KiB

  1. #jinja2: lstrip_blocks: "True"
  2. [Unit]
  3. Description=Matrix Postgres server
  4. After=docker.service
  5. Requires=docker.service
  6. DefaultDependencies=no
  7. [Service]
  8. Type=simple
  9. Environment="HOME={{ matrix_systemd_unit_home_path }}"
  10. ExecStartPre=-{{ matrix_host_command_docker }} stop matrix-postgres
  11. ExecStartPre=-{{ matrix_host_command_docker }} rm matrix-postgres
  12. ExecStart={{ matrix_host_command_docker }} run --rm --name matrix-postgres \
  13. --log-driver=none \
  14. --user={{ matrix_user_uid }}:{{ matrix_user_gid }} \
  15. --cap-drop=ALL \
  16. --read-only \
  17. --tmpfs=/tmp:rw,noexec,nosuid,size=100m \
  18. --tmpfs=/run/postgresql:rw,noexec,nosuid,size=100m \
  19. --network={{ matrix_docker_network }} \
  20. {% if matrix_postgres_container_postgres_bind_port %}
  21. -p {{ matrix_postgres_container_postgres_bind_port }}:5432 \
  22. {% endif %}
  23. --env-file={{ matrix_postgres_base_path }}/env-postgres-server \
  24. --mount type=bind,src={{ matrix_postgres_data_path }},dst=/var/lib/postgresql/data \
  25. --mount type=bind,src=/etc/passwd,dst=/etc/passwd,ro \
  26. {% for arg in matrix_postgres_container_extra_arguments %}
  27. {{ arg }} \
  28. {% endfor %}
  29. {{ matrix_postgres_docker_image_to_use }}
  30. ExecStop=-{{ matrix_host_command_docker }} stop matrix-postgres
  31. ExecStop=-{{ matrix_host_command_docker }} rm matrix-postgres
  32. Restart=always
  33. RestartSec=30
  34. SyslogIdentifier=matrix-postgres
  35. [Install]
  36. WantedBy=multi-user.target