Skip to content

Instantly share code, notes, and snippets.

@ruilvo
Created January 26, 2025 14:35
Show Gist options
  • Select an option

  • Save ruilvo/c6b82e447ad46abb7e8c22a8702ec62e to your computer and use it in GitHub Desktop.

Select an option

Save ruilvo/c6b82e447ad46abb7e8c22a8702ec62e to your computer and use it in GitHub Desktop.
Docker static HTML + SFTP
SFTP_USERS=SOME_USER:SOME_PW:1001
services:
webserver:
image: nginx:latest
container_name: nginx_server
ports:
- "127.0.0.1:9109:80" # Bind to localhost and port 9109
volumes:
- html:/usr/share/nginx/html:rw
restart: always
sftp:
image: atmoz/sftp:latest
container_name: sftp_server
ports:
- "2222:22" # SFTP server listens on port 2222
volumes:
- sftp-data:/home/user/upload
- html:/usr/share/nginx/html
environment:
SFTP_USERS: ${SFTP_USERS} # Read credentials from the .env file
restart: always
volumes:
html:
sftp-data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment