docker-compose.yml 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. SSH_CLIENT_PUBLIC_KEYS_APPEND_ONLY: |
  15. ssh-rsa ...
  16. ssh-rsa ...
  17. read_only: true
  18. volumes:
  19. - type: volume
  20. source: ssh_host_keys
  21. target: /etc/ssh/host_keys
  22. read_only: false
  23. - type: volume
  24. source: repository
  25. target: /repository
  26. read_only: false
  27. - type: tmpfs
  28. target: /home/borg/.ssh # authorized_keys
  29. tmpfs:
  30. # nosuid,nodev,noexec added by default
  31. mode: '1777'
  32. size: 16k
  33. - type: tmpfs
  34. # > FileNotFoundError: [Errno 2] No usable temporary directory found [...]
  35. target: /tmp
  36. tmpfs:
  37. mode: '1777'
  38. size: 1M
  39. ports:
  40. - '127.0.0.1:2200:2200'
  41. cap_drop: [ALL]
  42. security_opt: [no-new-privileges]
  43. # docker-compose >=2.2,<3
  44. cpus: 0.8
  45. mem_limit: 64M
  46. # https://docs.docker.com/compose/compose-file/compose-file-v2/