This is a short post: Just in case you need to run docker compose as a user other than root with systemd, this is one example how to do it. The below example is to run paperless-ngx in docker under ‘paperless’ user:
root@X:~# cat /etc/systemd/system/docker-paperless.service
[Unit]
Description=Paperless
After=docker.service
Requires=docker.service
[Service]
Type=oneshot
RemainAfterExit=true
TimeoutSec=900
WorkingDirectory=/home/paperless/paperless-ngx
User=paperless
Group=docker
ExecStart=/usr/bin/docker compose up -d
ExecStop=/usr/bin/docker compose down
[Install]
WantedBy=multi-user.target