One line in a unit file stops a compromised service from writing to most of the disk.
[Service]
ProtectSystem=strict
StateDirectory=myapp
ReadWritePaths=/srv/uploads
strict mounts the whole file system hierarchy read-only for the service, except /dev, /proc and /sys. StateDirectory=myapp creates /var/lib/myapp and keeps it writable, so it needs no extra line. ReadWritePaths= opens any other directory the service must write to, here /srv/uploads. If the service logs to a file under /var/log, add that path too or use LogsDirectory=, or it will fail with “Read-only file system”. Check the result with systemd-analyze security. Other related options are ProtectHome= and PrivateTmp=.
Further reading: systemd.exec manual page