docker-compose.yml 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. read_only: true
  30. volumes:
  31. - type: volume
  32. source: ssh_host_keys
  33. target: /etc/ssh/host_keys
  34. read_only: false
  35. - type: volume
  36. source: repository
  37. target: /repository
  38. read_only: false
  39. #- type: volume
  40. # source: additional_repositories
  41. # target: /additional-repositories
  42. # read_only: false
  43. - type: tmpfs
  44. target: /home/borg/.ssh # authorized_keys
  45. tmpfs:
  46. # nosuid,nodev,noexec added by default
  47. mode: '1777'
  48. size: 16k
  49. - type: tmpfs
  50. # > FileNotFoundError: [Errno 2] No usable temporary directory found [...]
  51. target: /tmp
  52. tmpfs:
  53. mode: '1777'
  54. size: 1M
  55. ports:
  56. - '127.0.0.1:2200:2200'
  57. cap_drop: [ALL]
  58. security_opt: [no-new-privileges]
  59. # docker-compose >=2.2,<3
  60. cpus: 0.8
  61. mem_limit: 128M
  62. # https://docs.docker.com/compose/compose-file/compose-file-v2/