A lightweight file sharing web application that allows users to upload and download files.
644
A lightweight file sharing web application built with Go that allows users to upload and download files without authentication.
shreevatshan/dragndropThe fastest way to run the application is with the published image.
docker run -d \
--name dragndrop \
-p 8080:8080 \
-e PUBLIC_DOMAIN=files.example.com \
-v dragndrop_uploads:/app/static/uploads \
shreevatshan/dragndrop:latest
The server will start at http://localhost:8080
PUBLIC_DOMAIN is required — set it to the address other machines reach this host on (its LAN IP, hostname, or domain). It's the host that shareable Copy link URLs point at, so a link you copy still resolves when pasted on another machine. The container refuses to start without it.
Uploaded files are persisted in the dragndrop_uploads volume so they survive container recreation.
Create a docker-compose.yaml:
services:
dragndrop:
image: shreevatshan/dragndrop:latest
container_name: dragndrop
restart: unless-stopped
environment:
# REQUIRED — host that shareable "Copy link" URLs point at.
- PUBLIC_DOMAIN=${PUBLIC_DOMAIN:?set PUBLIC_DOMAIN to your host's address}
ports:
# Change HOST_PORT to publish on a different host port.
- "${HOST_PORT:-8080}:8080"
volumes:
# Persist uploaded files across container recreation.
- uploads:/app/static/uploads
volumes:
uploads:
Then run:
PUBLIC_DOMAIN=files.example.com docker compose up -d
Each setting is read from a command-line flag if present, otherwise an environment variable, otherwise its default (flags win over env):
| Flag | Env | Default | Purpose |
|---|---|---|---|
-public-domain | PUBLIC_DOMAIN | required | Host (or full origin) that shareable Copy link URLs point at |
-port | PORT | 8080 | Port the server binds to |
-basepath | BASE_PATH | (none) | Path prefix the app is served under, e.g. /fileshare |
Only the Copy link action uses the public domain; assets, uploads and downloads are loaded relative to the page, so the app itself still works fine when you browse it via localhost.
Examples:
docker run -d -p 8080:8080 \
-e PUBLIC_DOMAIN=https://files.example.com \
-v dragndrop_uploads:/app/static/uploads \
shreevatshan/dragndrop:latest
latest — the most recent buildlinux/amd64 and linux/arm64.If you'd rather build and run the application directly, you'll need Go 1.16 or higher.
# Clone the repository
git clone https://github.com/shreevatshan/dragndrop.git
cd dragndrop
# Run the application
go run main.go
The server will start at http://localhost:8080
-public-domain is required; the other flags (and their environment-variable equivalents) are optional:
# Required public domain, plus a custom port and path prefix
go run main.go -public-domain 192.168.1.50 -port 9000 -basepath /fileshare
# Equivalent via environment variables
PUBLIC_DOMAIN=192.168.1.50 PORT=9000 BASE_PATH=/fileshare go run main.go
git clone https://github.com/shreevatshan/dragndrop.git
cd dragndrop
docker build -t dragndrop .
.
├── main.go # Go server implementation
├── Dockerfile # Multi-arch container build
├── docker-compose.yaml # Compose deployment
├── templates/
│ └── index.html # HTML template for the web interface
├── static/
│ ├── css/
│ │ └── style.css # CSS styles
│ ├── js/
│ │ └── app.js # JavaScript functionality
│ └── uploads/ # Directory for uploaded files
└── README.md # This file
This project is open source and available under the MIT License.
Content type
Image
Digest
sha256:8f07b1135…
Size
10 MB
Last updated
3 months ago
docker pull shreevatshan/dragndrop