Skip to content
Snippets Groups Projects
postfix.service 534 B
Newer Older
[Unit]
Description=%p
Pierre Ozoux's avatar
Pierre Ozoux committed

# Requirements
Requires=docker.service

Pierre Ozoux's avatar
Pierre Ozoux committed
# Dependency ordering
After=docker.service
Pierre Ozoux's avatar
Pierre Ozoux committed
After=rsyslog.service
Pierre Ozoux's avatar
Pierre Ozoux committed

[Service]
Restart=always
Pierre Ozoux's avatar
Pierre Ozoux committed
RestartSec=20
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill %p
ExecStartPre=-/usr/bin/docker rm %p
Pierre Ozoux's avatar
Pierre Ozoux committed
ExecStart=/usr/bin/docker run \
Pierre Ozoux's avatar
Pierre Ozoux committed
  --rm \
Pierre Ozoux's avatar
Pierre Ozoux committed
  --name %p \
Pierre Ozoux's avatar
Pierre Ozoux committed
  -v /data/runtime/dev/log:/dev/log \
  -v /data/runtime/postfix/:/data \
Pierre Ozoux's avatar
Pierre Ozoux committed
  -p 25:25 \
  pierreozoux/postfix
ExecReload=/usr/bin/docker restart %p
ExecStop=/usr/bin/docker stop %p

[Install]
WantedBy=multi-user.target
Pierre Ozoux's avatar
Pierre Ozoux committed