If you tend to use Nginx web server with Lets-encrypt certificates, You can make use of systemd unit file as below:

[Unit]
Description=NGinx Proxy
After=docker.service
Requires=docker.service

[Install]
WantedBy=multi-user.target

[Service]
TimeoutStartSec=0
ExecStartPre=-/usr/bin/docker kill nginx
ExecStartPre=-/usr/bin/docker rm nginx
ExecStartPre=/usr/bin/docker pull nginx:alpine
ExecStart=/usr/bin/docker run -p80:80 \
                              -p443:443 \
                              -v /letsencrypt:/etc/letsencrypt \
                              -v /secrets:/etc/nginx/certs \
                              -v /nginx_conf:/etc/nginx/conf.d \
                              -v /nginx_vhost:/etc/nginx/vhost.d \
                              -v /nginx_ssl_challenges:/usr/share/nginx/html \
                              --name nginx nginx:alpine
ExecStop=/usr/bin/docker stop nginx
Restart=always