docker-compose.yml 866 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. version: '2.3'
  2. volumes:
  3. ssh_host_keys:
  4. data:
  5. services:
  6. sshd:
  7. build: .
  8. image: docker.io/fphammerle/sftpd
  9. container_name: sftpd
  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: data
  22. target: /data
  23. read_only: false
  24. - type: tmpfs
  25. target: /home/nonroot/.ssh # authorized_keys
  26. tmpfs:
  27. # nosuid,nodev,noexec added by default
  28. size: 16k
  29. ports:
  30. - '127.0.0.1:2200:2200'
  31. cap_drop: [ALL]
  32. cap_add: [SETUID, SETGID, SYS_CHROOT]
  33. security_opt: [no-new-privileges]
  34. # docker-compose >=2.2,<3
  35. cpus: 0.8
  36. mem_limit: 64M
  37. # https://docs.docker.com/compose/compose-file/compose-file-v2/