[Unit] Description=Redis Container After=docker.service Requires=docker.service [Service] Type=simple restart=always TimeoutStartSec=120 ExecStartPre=-/usr/bin/docker pull redis:4-alpine ExecStartPre=-/usr/bin/docker kill redis_service ExecStartPre=-/usr/bin/docker rm redis_service ExecStart=/usr/bin/docker run --name redis_service redis:alpine ExecStop=/usr/bin/docker stop redis_service [Install] WantedBy=multi-user.target