Nexus docker systemd file

[Unit]
Description=Nexus3 Server
After=docker.service
Requires=docker.service

[Service]
Type=simple
User=nexus
Group=nexus
TimeoutStartSec=0
Restart=on-failure
RestartSec=30s
ExecStartPre=-/usr/bin/docker kill nexus-server
ExecStartPre=-/usr/bin/docker rm nexus-server
ExecStartPre=/usr/bin/docker pull sonatype/nexus3
ExecStart=/usr/bin/docker run  --name nexus-server \
--publish 8082:8081 \
--publish 8087:8087 \
--volume /opt/nexus:/nexus-data \
sonatype/nexus3
SyslogIdentifier=nexus
ExecStop=/usr/bin/docker stop nexus-server

[Install]
WantedBy=multi-user.target