docker-compose.yml 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. version: '2.3'
  2. volumes:
  3. ssh_host_keys:
  4. repository:
  5. #additional_repositories:
  6. services:
  7. sshd:
  8. build: .
  9. image: docker.io/fphammerle/borgbackup-sshd
  10. container_name: borgbackup_sshd
  11. environment:
  12. SSH_CLIENT_PUBLIC_KEYS: |
  13. ssh-rsa ...
  14. ssh-rsa ...
  15. SSH_CLIENT_PUBLIC_KEYS_APPEND_ONLY: |
  16. ssh-rsa ...
  17. ssh-rsa ...
  18. #REPO_PATH_foo: /additional-repositories/foo
  19. #SSH_CLIENT_PUBLIC_KEYS_foo: |
  20. # ssh-rsa ...
  21. # ssh-rsa ...
  22. #SSH_CLIENT_PUBLIC_KEYS_APPEND_ONLY_foo: |
  23. # ssh-rsa ...
  24. # ssh-rsa ...
  25. #REPO_PATH_bar: /additional-repositories/bar
  26. #SSH_CLIENT_PUBLIC_KEYS_APPEND_ONLY_bar: |
  27. # ssh-rsa ...
  28. # ssh-rsa ...
  29. #SSH_CLIENT_PUBLIC_KEYS_ALL: |
  30. # ssh-rsa ...
  31. # ssh-rsa ...
  32. read_only: true
  33. volumes:
  34. - type: volume
  35. source: ssh_host_keys
  36. target: /etc/ssh/host_keys
  37. read_only: false
  38. - type: volume
  39. source: repository
  40. target: /repository
  41. read_only: false
  42. #- type: volume
  43. # source: additional_repositories
  44. # target: /additional-repositories
  45. # read_only: false
  46. - type: tmpfs
  47. target: /home/borg/.ssh # authorized_keys
  48. tmpfs:
  49. # nosuid,nodev,noexec added by default
  50. mode: '1777'
  51. size: 16k
  52. - type: tmpfs
  53. # > FileNotFoundError: [Errno 2] No usable temporary directory found [...]
  54. target: /tmp
  55. tmpfs:
  56. mode: '1777'
  57. size: 1M
  58. ports:
  59. - '127.0.0.1:2200:2200'
  60. cap_drop: [ALL]
  61. security_opt: [no-new-privileges]
  62. # docker-compose >=2.2,<3
  63. cpus: 0.8
  64. mem_limit: 128M
  65. # https://docs.docker.com/compose/compose-file/compose-file-v2/