Example on ssh-server for backup via docker-compose

I need to setup an ssh-server with public-private keypair authentication. This server will be the target for backups via rsync-ssh and it needs to be accessible from the internet, so security is an issue. Rather than creating a virtual linux machine just for this purpose I’d like to solve this with docker-compse. Would it be possible to setup a docker container as rsync target using docker-compose? There are many containers providing rsync but I did not find examples how to realize this with docker-compose?