This project automates the process of cloning a GitHub repository into a Docker container. It builds the code to generate the necessary HTML, CSS, and JavaScript files, which are then stored in MinIO. The entire process is orchestrated through a triggered shell script within the Docker container and a TypeScript index file that manages the upload to MinIO.
The architecture prioritizes security by ensuring that code execution and file handling occur within isolated Docker containers in the cloud. This setup minimizes the risk associated with executing arbitrary code, as all operations are confined to the containerized environment.
This solution is designed to scale efficiently.
The goal is to implement real-time logging of the build process, similar to the logging features provided by Vercel during project builds and deployments to AWS.
To achieve real-time logging, the following components will be utilized:
- WebSockets: A protocol for real-time communication, enabling live updates during the build process.
- Redis: Used for streaming build logs to the appropriate user in real time.
-
WebSocket Connection: When a user navigates to the deployments page, a WebSocket connection is established between the user and the server.
-
Executing the Build Command: The build command is executed within the Docker container via a TypeScript script. During this process, logs generated by the build can be streamed to Redis.
-
Streaming Logs to the User: The logs published to Redis will be associated with the corresponding ProjectID. The server listens for these logs and retrieves the appropriate WebSocket object, sending the logs to the connected user for display in the browser.
- Docker 🐳
- Dockerode
- MinIO for storing files☁️
- Redis server 🗄️
- WebSocket library 🔌
- Clone the repository.
- Set up your MinIO credentials and S3 .
- Configure your Redis instance.
- Build and run the Docker container.
- Deploy your application to Docker Hub.
- Navigate to the deployments page in your web application.
- Click the deploy button to trigger the build process.
- Monitor the build logs in real time as they are displayed in the browser.
- 🐳 Docker
- ☁️ Minio (Self Hosted alternative for AWS S3)
- 🗄️ Redis
- 🔌 WebSockets
- 📜 TypeScript
- 🐚 Shell Scripting
- 🌐 Dockerode
Built with ❤️ by Janhavi