This project is a build and deployment server that automatically builds your front-end project, uploads the build output to AWS S3, and publishes build logs to Redis. It runs inside Docker and is designed for ephemeral, self-contained builds.
- Project Overview
- Features
- Prerequisites
- Setup
- Running the Containers
- Environment Variables
- How it Works
- Stopping & Cleanup
- Future Improvements
The Builder Server:
- Clones the repository into
/home/app/output - Runs
npm installandnpm run build - Uploads the
distfolder contents to AWS S3 - Publishes build logs to Redis for real-time monitoring
- Runs in a self-contained Docker container
Redis and RedisInsight are included to allow log monitoring.
- Automatic build & deployment
- Real-time log publishing to Redis
- S3 upload with MIME type detection
- Works fully inside Docker
- Network-isolated setup for predictable behavior
- Docker installed
- AWS credentials with S3 write access
- Redis and RedisInsight (managed via Docker in this setup)
- Clone this repository:
git clone <your-repo-url>
cd builder- Create the
.env.localfile:
cp .env.example .env.localEdit .env.local with your own configuration (see Environment Variables).
We recommend isolating everything on a single Docker network:
docker network create redis-netStart Redis and RedisInsight:
docker compose -f docker-compose.redis.yml up -dBuild & run the builder server:
docker build -t build-server .
docker run --rm --env-file .env.local --network redis-net build-server--rmensures the container is removed after it exits.- Logs will appear in RedisInsight on port
5540.
The builder server requires the following variables in .env.local:
# Redis
REDIS_URL=redis://redis:6379
# AWS S3
AWS_REGION=<your-region>
AWS_ACCESS_KEY_ID=<your-access-key>
AWS_SECRET_ACCESS_KEY=<your-secret-key>
BUCKET_NAME=<your-s3-bucket>
# Project
PROJECT_ID=<unique-project-id>Note: Use the Redis service name (redis) from the Docker network, not localhost.
- Builder container clones the repo into
/home/app/output. - Runs
npm install→npm run build. - Recursively scans the
distfolder. - Uploads all files to S3 with proper MIME types.
- Publishes log events to Redis (
logs:<PROJECT_ID>). - Disconnects from Redis and exits cleanly after the upload.
Stop Docker Compose services:
docker compose -f docker-compose.redis.yml downRemove Docker network (optional):
docker network rm redis-net- Support multiple build environments (e.g., React, Angular, Vue)
- Retry mechanism for failed S3 uploads
- Slack or email notifications for build completion/failures
- Persistent storage for builds to avoid repeated cloning