[Unit] Description=Immich ({{ immich_identifier }}) {% for service in immich_systemd_required_services_list %} Requires={{ service }} After={{ service }} {% endfor %} DefaultDependencies=no [Service] Type=simple Environment="HOME={{ devture_systemd_docker_base_systemd_unit_home_path }}" ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ immich_identifier }} 2>/dev/null' ExecStartPre=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ immich_identifier }} 2>/dev/null' ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} create \ --rm \ --name={{ immich_identifier }} \ --log-driver=none \ --network={{ immich_container_network }} \ --env-file={{ immich_base_path }}/env \ --label-file={{ immich_base_path }}/labels \ --mount type=bind,src={{ immich_config_dir_path }},dst=/config \ --mount type=bind,src={{ immich_photos_dir_path }},dst=/photos \ --mount type=bind,src={{ immich_import_dir_path }},dst=/import,ro \ --tmpfs=/tmp:rw,noexec,nosuid,size=512m \ {% for arg in immich_container_extra_arguments %} {{ arg }} \ {% endfor %} {{ immich_container_image }} {% for network in immich_container_additional_networks %} ExecStartPre={{ devture_systemd_docker_base_host_command_docker }} network connect {{ network }} {{ immich_identifier }} {% endfor %} ExecStart={{ devture_systemd_docker_base_host_command_docker }} start --attach {{ immich_identifier }} ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} stop --time={{ devture_systemd_docker_base_container_stop_grace_time_seconds }} {{ immich_identifier }} 2>/dev/null' ExecStop=-{{ devture_systemd_docker_base_host_command_sh }} -c '{{ devture_systemd_docker_base_host_command_docker }} rm {{ immich_identifier }} 2>/dev/null' Restart=always RestartSec=30 SyslogIdentifier={{ immich_identifier }} [Install] WantedBy=multi-user.target