Skip to content

Devploy is a browser-based platform for running temporary Docker environments with custom Dockerfiles, Compose support, a built-in terminal, dynamic port exposure, guest mode, and OPFS storage for fast retrieval. Sessions last up to 15 minutes before auto-cleanup.

License

Notifications You must be signed in to change notification settings

meAyushSharma/devploy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Devploy : Development Pod and Configuration Builds

Logo

TL;DR

Devploy is an on-demand platform for running temporary Docker environments in the browser. Users can create containers using Dockerfiles or Docker Compose, interact via a built-in terminal, and expose custom ports dynamically without manual configuration. It supports guest mode for quick access without an account and uses OPFS storage to save configurations locally for fast retrieval. Each session runs for up to 15 minutes before automatic cleanup.

Key Features

  • Instant Deployments – Spin up containers in seconds and use them for up to 15 minutes before automatic cleanup.
  • Browser-Based Terminal – Interact with your container directly from the browser, no SSH required.
  • Custom Dockerfiles & Compose Support – Define your own Dockerfiles or use Docker Compose for multi-container setups.
  • Dynamic Port Exposure – No need for manual configurations; Devploy automatically exposes user-defined ports.
  • Ephemeral Environments – Every session is temporary, ensuring a clean slate for each test.
  • Ask Devai - Converse with AI to solve queries regarding configurations.

Devploy simplifies testing and deployment, making it a powerful tool for developers who need fast, disposable environments.


Architecture

  1. Underlying technology - Docker, it uses Docker to orchestrate and manage active services and networks.
  2. Service Management - Dockerode, it uses dockerode.js to manage Docker containers via APIs.
  3. Connection to service - WebSockets, it uses WebSocket server to stream from/to containers.
  4. Terminal Access - Xterm.js, it uses powerful Xterm React library to interact with running containers.
  5. Access Service - It uses reverse proxy server built in-house to route requests to specific services running inside containers with specified port bindings.
  6. Browser Storage - OPFS, it uses Open Private File System to store configuration files locally.

Architecture image

Tech Stack

  • Backend - Node.js with Express.js
  • Frontend - React.js with Tailwind CSS
  • Database - PostgreSQL
  • Reverse Proxy - Caddy
  • Notable Implementations -
    • Dockerode : For managing Docker images and containers.
    • WebSocket Server : For managing WebSocket connections.
    • Resend : For sending verification emails.
    • Xterm.js : For browser-based terminal.
    • MindsDB AI integration : codellama-70b llm model with OpenAI chat completions API.

Reason for Building

  1. To provide a simple process for building Docker configurations.
  2. To enable users to test environments they build.
  3. To ensure Devploy is easy to use and navigate.

Implementation

1. Configuration Builds

  1. Integrated Docker Hub with tags, NPM registry, Python Package Index (pip), Cargo package registry, RubyGems registry in one place for seamless Dockerfile configuration.
  2. Define environment variables, port mappings, network configurations, and commands.
  3. Support for all network configurations except overlays.
  4. Build Docker Compose configs with multi-service support.
  5. Download configurations to keep on your device.
  6. Deploy your custom-built environments for 15 (+ ~2) minutes with 512 MB RAM. Run tests, services, and host applications at the ports specified in the Dockerfile with a unique endpoint.
  7. OPFS storage is used to save configurations locally, allowing gigabytes of storage for extremely fast retrieval without overloading main thread by using web-workers on client.
  8. Web Workers are used to manage OPFS storage, keeping the main thread free.

2. Service Orchestration and Management

  1. Implemented Dockerode library to interact with Docker daemon and orchestrate containers.
  2. Defined APIs using Express server to manage Docker images and containers via Dockerode.
  3. Created a reverse-proxy using an HTTP server to efficiently direct incoming traffic to the intended service inside the container.
  4. Provided unique authenticated and protected endpoints for each exposed port, binding them to services inside the container.
  5. Created a WebSocket server by upgrading incoming HTTP requests to maintain full-duplex communication between the terminal inside the container and the browser terminal on the client.
  6. Created a cron job service to automatically clean up unused images and containers:
    a. Containers and their images are removed after 15 (+~2) minutes.
    b. Old base images are removed after 30 minutes.
    c. Corrupted containers/images are pruned every minute.

Installation

  1. Fork this repository.
  2. Clone the repository to your local environment.
  3. In server and client folders, create a .env file and copy the contents from .env.example, then modify it accordingly.
  4. For local development, run:
    docker compose -f docker-compose.dev.yml up --build

Note:

  • You need Docker installed: Install Docker Guide
  • Devploy uses Caddy's local authority to issue SSL certificates for local development. You need to set it up locally by:
    • Retrieving root SSL certificates from the Caddy container: /data/caddy/pki/authorities/local/root.crt
    • Setting up certificate management for your OS.
    • Adding the following entries to your hosts file:
      127.0.0.1 devploy.localhost
      127.0.0.1 server.devploy.localhost
    Now, it should be accessible at devploy.localhost.

Other Features

  1. Guest Mode - Use the app without an account. Configurations are stored locally but cannot be deployed. Local data is volatile and will be lost if site data is cleared.
  2. Robust Authentication - Google Sign-In, Email verification using Resend.
  3. One-Click Configuration Download.
  4. Password Recovery features implemented.

Image Gallery

Home:
Home

Docker Configuration:
Docker Configuration

Active Services:
Active Services

Terminal Access:
Terminal Access

About

Devploy is a browser-based platform for running temporary Docker environments with custom Dockerfiles, Compose support, a built-in terminal, dynamic port exposure, guest mode, and OPFS storage for fast retrieval. Sessions last up to 15 minutes before auto-cleanup.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages