Sign inSign up

nerwander/docker-drop

By nerwander

•Updated about 1 year ago

Image
0

605

nerwander/docker-drop repository overview

⁠Docker Drop 🐳

CI Docker Docker Hub Docker Image Size

A simple Flask web application that allows users to drag and drop text or images to store them in files. The application runs in a Docker container and saves files to a mapped external directory.

⁠Features

  • Drag & Drop Interface: Intuitive web interface for dropping text and images
  • Multiple Input Methods:
    • Drag and drop files or text
    • Click to select files
    • Paste text or images (Ctrl+V)
  • File Support:
    • Text files (.txt)
    • Images (PNG, JPG, GIF, SVG, WebP, BMP)
    • Email files (.msg, .eml) - Drag emails directly from Outlook!
  • Unique Filenames: Files are saved with timestamp and unique ID
  • Dockerized: Runs in a secure Docker container
  • External Storage: Files are saved to a mapped external directory
  • Optional File Browser: Browse stored files via web interface

⁠Quick Start

The easiest way to run Docker Drop is using the pre-built image from Docker Hub:

# Create output directory
mkdir output

# Run with Docker
docker run -d \
  --name docker-drop \
  -p 5000:5000 \
  -v $(pwd)/output:/output \
  nerwander/docker-drop:latest

# Or run with Docker Compose
curl -o docker-compose.yml https://raw.githubusercontent.com/benstaniford/docker-drop/main/docker-compose.yml
docker-compose up -d
⁠Building from Source

If you want to build the image yourself:

⁠Prerequisites
  • Docker and Docker Compose installed on your system
  • Port 5000 and 8080 available (or modify the ports in docker-compose.yml)
⁠1. Clone or Download
git clone <repository-url>
cd docker-drop
⁠2. Create Output Directory

Create a local directory where files will be stored:

mkdir output
⁠3. Start the Application
docker-compose up -d

This will:

  • Build the Docker image
  • Start the Flask application on port 5000
  • Start an optional file browser on port 8080
  • Map the ./output directory to /output in the container
⁠4. Access the Application

⁠Usage

  1. Open http://localhost:5000⁠ in your web browser
  2. Drop content in one of these ways:
    • Drag and drop text, image, or email files onto the drop zone
    • Drag emails directly from Outlook (saves as .msg or .eml files)
    • Click the drop zone to select files
    • Copy text or images and paste them (Ctrl+V) anywhere on the page
  3. Preview your content in the preview area
  4. Click "Store Content" to save the file
  5. Files will be saved in the ./output directory with unique names

⁠File Naming Convention

Files are automatically named using the following pattern:

  • Format: YYYYMMDD_HHMMSS_UNIQUEID.extension
  • Example: 20250910_143052_a1b2c3d4.txt

⁠Configuration

⁠Custom Output Directory

To use a different output directory, modify the volume mapping in docker-compose.yml:

volumes:
  - /path/to/your/directory:/output  # Change this path
⁠Custom Ports

To use different ports, modify the port mappings in docker-compose.yml:

ports:
  - "3000:5000"  # Application will be available on port 3000
⁠Disable File Browser

If you don't want the file browser, comment out or remove the file-browser service in docker-compose.yml.

⁠Development

⁠Running Locally (without Docker)
  1. Install dependencies:

    pip install -r requirements.txt
    
  2. Create output directory:

    mkdir output
    
  3. Set environment variable (optional):

    export FLASK_ENV=development
    
  4. Run the application:

    python app.py
    
  5. Access at http://localhost:5000⁠

⁠Building the Docker Image
docker build -t docker-drop .
⁠Running with Docker (without compose)
docker run -d \
  --name docker-drop \
  -p 5000:5000 \
  -v $(pwd)/output:/output \
  docker-drop

⁠API Endpoints

⁠POST /store

Store text or image content.

Request Body:

{
  "type": "text|image",
  "content": "content_data"
}

Response:

{
  "success": true,
  "filename": "20250910_143052_a1b2c3d4.txt",
  "message": "Text saved as 20250910_143052_a1b2c3d4.txt"
}
⁠GET /health

Health check endpoint.

Response:

{
  "status": "healthy"
}

⁠Security Considerations

  • The application runs as a non-root user inside the container
  • File uploads are validated for type and content
  • The output directory is the only writable location
  • No file execution capabilities
  • Basic input sanitization is implemented

⁠Troubleshooting

⁠Application won't start
  • Check if ports 5000 and 8080 are available
  • Ensure Docker and Docker Compose are installed
  • Check logs: docker-compose logs docker-drop
⁠Files not saving
  • Verify the output directory exists and has write permissions
  • Check the volume mapping in docker-compose.yml
  • Check container logs for errors
⁠Can't access the application
  • Ensure the application is running: docker-compose ps
  • Check if the port is accessible: curl http://localhost:5000/health
  • Verify firewall settings

⁠License

This project is licensed under the MIT License - see the LICENSE file for details. A python flask application that allows anything to be dropped into a web site to then be saved as a date stamped file.

Tag summary

Content type

Image

Digest

sha256:c4d007c3f…

Size

45.5 MB

Last updated

about 1 year ago

docker pull nerwander/docker-drop