We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Generate public and private keys for the host (use no passphrase):
mkdir -p keys/{host,user} ssh-keygen -t ed25519 -f keys/host/ssh_host_ed25519_key < /dev/null ssh-keygen -t rsa -b 4096 -f keys/host/ssh_host_rsa_key < /dev/null
Put your public user key(s) in keys/user.
keys/user
Add an sftp service:
sftp
app/compose.yaml:
sftp: image: atmoz/sftp command: user:pass:1001 ports: - "2222:22" volumes: - ./keys/host/ssh_host_ed25519_key:/etc/ssh/ssh_host_ed25519_key:ro - ./keys/host/ssh_host_rsa_key:/etc/ssh/ssh_host_rsa_key:ro - ./keys/user:/home/user/.ssh/keys:ro - sftp_data:/home/user/upload:rw
And a volume:
volumes: sftp_data:
Also add the sftp_data volume to the caddy service:
sftp_data
caddy
app/compose.yaml
services: caddy: volumes: - sftp_data:/upload:ro
Add to the Caddy configuration
app/caddy/Caddyfile:
# Serve uploaded files handle_path /upload/* { root * /upload file_server # Disable the 'Expect: 100-continue' header for easier uploads header Expect nil # Long-term caching for uploaded files header Cache-Control "public, max-age=2592000, immutable" }
docker compose cp path/to/files/. sftp:/home/user/upload/