docker-compose.yml 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. version: '2.3'
  2. volumes:
  3. ssh_host_keys:
  4. repository:
  5. services:
  6. sshd:
  7. build: .
  8. image: docker.io/fphammerle/borgbackup-sshd
  9. container_name: borgbackup_sshd
  10. environment:
  11. SSH_CLIENT_PUBLIC_KEYS: |
  12. ssh-rsa ...
  13. ssh-rsa ...
  14. read_only: true
  15. volumes:
  16. - type: volume
  17. source: ssh_host_keys
  18. target: /etc/ssh/host_keys
  19. read_only: false
  20. - type: volume
  21. source: repository
  22. target: /repository
  23. read_only: false
  24. - type: tmpfs
  25. target: /home/borg/.ssh # authorized_keys
  26. tmpfs:
  27. # nosuid,nodev,noexec added by default
  28. mode: '1777'
  29. size: 16k
  30. - type: tmpfs
  31. # > FileNotFoundError: [Errno 2] No usable temporary directory found [...]
  32. target: /tmp
  33. tmpfs:
  34. mode: '1777'
  35. size: 1M
  36. ports:
  37. - '127.0.0.1:2200:2200'
  38. cap_drop: [ALL]
  39. security_opt: [no-new-privileges]
  40. # docker-compose >=2.2,<3
  41. cpus: 0.8
  42. mem_limit: 64M
  43. # https://docs.docker.com/compose/compose-file/compose-file-v2/