Skip to content

Bagel Server is a containerized development environment designed for the Bagel project, an infrastructure management and deployment platform similar to Env0. This Docker image provides a complete development toolkit with all the necessary tools for working with infrastructure as code, cloud providers, and modern web development.

Notifications You must be signed in to change notification settings

TheBagelProject/bagel-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

8 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Bagel Server - Development Environment

Bagel Server is a containerized development environment designed for the Bagel project, an infrastructure management and deployment platform similar to Env0. This Docker image provides a complete development toolkit with all the necessary tools for working with infrastructure as code, cloud providers, and modern web development.

What is Bagel?

Bagel is a comprehensive infrastructure management platform that enables developers and DevOps teams to:

  • Manage Terraform deployments
  • Connect with cloud providers (AWS, etc.)
  • Handle GitHub integrations and repositories
  • Streamline infrastructure provisioning workflows

Development Environment Tools

This containerized environment includes:

  • Git - Version control system for managing Bagel's codebase
  • Node.js (v20.x) - JavaScript runtime for the Bagel frontend and backend services
  • Terraform (v1.6.2) - Infrastructure as code tool for deployment management
  • AWS CLI (v2.13.25) - Command line interface for AWS cloud operations
  • Workspace folder - Pre-configured development workspace at /workspace

Build the Image

To build the Docker image locally, run:

docker build -t bagel-server:latest .

Pull from Docker Hub

If the image is published to Docker Hub, you can pull it directly:

# Replace 'yourusername' with the actual Docker Hub username
docker pull yourusername/bagel-server:latest

Run the Container

Option 1: Using Docker directly

# Run interactively with bash shell
docker run -it --rm bagel-server:latest

# Run with volume mount to share files
docker run -it --rm -v ${PWD}:/workspace/project bagel-server:latest

Option 2: Using Docker Compose (Recommended)

# Start the container
docker-compose up -d

# Access the container shell
docker-compose exec dev-environment bash

# Stop the container
docker-compose down

Verify Installation

Once inside the container, you can verify all tools are installed:

git --version
node --version
npm --version
terraform version
aws --version

Usage Examples

Bagel Development Workflow

# Clone the Bagel project
git clone <bagel-repository-url>
cd bagel-project

# Install frontend dependencies
cd env0-lite-frontend
npm install

# Install backend dependencies  
cd ../bagel-server
npm install

# Run development servers
npm run dev

AWS CLI Configuration for Bagel Deployments

# Configure AWS credentials for cloud provider integration
aws configure

# Test AWS connectivity (used by Bagel for deployments)
aws s3 ls
aws sts get-caller-identity

Terraform Operations for Infrastructure Management

# Initialize Terraform (as used by Bagel's deployment engine)
terraform init

# Validate Terraform configurations
terraform validate

# Plan infrastructure changes (Bagel's deployment preview)
terraform plan

# Apply infrastructure (Bagel's deployment execution)
terraform apply

Git Operations for Repository Management

# Operations that Bagel performs with connected GitHub repos
git clone <repository-url>
git status
git add .
git commit -m "Infrastructure updates via Bagel"
git push origin main

Environment Variables

You can set environment variables when running the container:

docker run -it --rm \
  -e AWS_REGION=us-west-2 \
  -e AWS_PROFILE=default \
  -v ${PWD}:/workspace/project \
  bagel-server:latest

Volume Mounts

Common volume mounts you might want to use:

  • Project files: -v ${PWD}:/workspace/project
  • AWS credentials: -v ~/.aws:/root/.aws:ro
  • Git configuration: -v ~/.gitconfig:/root/.gitconfig:ro
  • SSH keys: -v ~/.ssh:/root/.ssh:ro

Troubleshooting

Permission Issues

If you encounter permission issues with mounted volumes, you may need to adjust file permissions or run the container with specific user permissions.

AWS CLI Authentication

Make sure to configure your AWS credentials either by:

  1. Mounting your ~/.aws directory
  2. Using environment variables
  3. Using IAM roles if running in AWS

Customization

You can customize this image by:

  1. Modifying the Dockerfile to add additional tools
  2. Updating version numbers for the installed packages
  3. Adding custom scripts or configurations

๐Ÿš€ Docker Hub Deployment

Automated Deployment (Recommended)

The repository includes a GitHub Actions workflow that automatically builds and pushes the Docker image to Docker Hub whenever code is pushed to the main branch.

Setup Required:

  1. Go to your GitHub repository settings โ†’ Secrets and variables โ†’ Actions
  2. Add the following secrets:
    • DOCKER_USERNAME: Your Docker Hub username
    • DOCKER_PASSWORD: Your Docker Hub password or access token

The workflow will automatically:

  • Build the Docker image for multiple platforms (AMD64 and ARM64)
  • Push to Docker Hub with appropriate tags
  • Update the Docker Hub repository description
  • Use caching for faster builds

Manual Deployment

To share the Bagel development environment manually:

Quick Deploy

# Login to Docker Hub
docker login

# Push using the PowerShell script
.\build.ps1 push -DockerHubUsername yourusername

Manual Deploy

# Tag for Docker Hub
docker tag bagel-server:latest yourusername/bagel-server:latest

# Push to Docker Hub
docker push yourusername/bagel-server:latest

For detailed deployment instructions, see DEPLOYMENT_GUIDE.md.

Using Published Image for Bagel Development

Once published, team members can quickly set up the Bagel development environment:

# Pull and run the Bagel dev environment
docker pull yourusername/bagel-server:latest
docker run -it --rm -v ${PWD}:/workspace/project yourusername/bagel-server:latest

# Or use in docker-compose.yml for Bagel development
services:
  bagel-dev:
    image: yourusername/bagel-server:latest
    volumes:
      - .:/workspace/project
      - ~/.aws:/root/.aws:ro  # For AWS integration testing
    environment:
      - AWS_REGION=us-east-1

Contributing to Bagel

This development environment is specifically configured for contributing to the Bagel project. It includes all necessary tools for:

  • Frontend development (Next.js, React, TypeScript)
  • Backend development (Node.js, Express, MongoDB)
  • Infrastructure management (Terraform, AWS CLI)
  • Version control and collaboration (Git, GitHub integration)

About

Bagel Server is a containerized development environment designed for the Bagel project, an infrastructure management and deployment platform similar to Env0. This Docker image provides a complete development toolkit with all the necessary tools for working with infrastructure as code, cloud providers, and modern web development.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published