Muhammad Faraz Malik commited on
Commit ·
da45a82
1
Parent(s): c26f194
feat(deploy): add root Dockerfile, docker-compose.yml, and AWS Free-Tier EC2 User-Data bootstrap script
Browse filesFiles changed (3)
- DockerfileAdded+27
- deploy/ec2_userdata.shAdded+45
- docker-compose.ymlAdded+12
123456789101112131415161718192021222324252627FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ PIP_NO_CACHE_DIR=1 \ PYTHONPATH=/app/src
RUN apt-get update && apt-get install -y --no-install-recommends \ git \ curl \ && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt pyproject.toml README.md SPEC.md ./COPY src ./srcCOPY tests ./testsCOPY .streamlit ./.streamlit
RUN pip install --upgrade pip && pip install -r requirements.txt
EXPOSE 8501
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \ CMD curl --fail http://localhost:8501/_stcore/health || exit 1
CMD ["streamlit", "run", "src/ui/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.headless=true"]123456789101112131415161718192021222324252627282930313233343536373839404142434445#!/bin/bash# AWS EC2 Free Tier (Ubuntu 22.04 / 24.04 or Amazon Linux 2023) User-Data Bootstrap Scriptset -euxo pipefail
# 1. Install Docker & Gitif command -v apt-get >/dev/null 2>&1; then apt-get update -y apt-get install -y git docker.io docker-compose-v2 systemctl enable --now dockerelif command -v dnf >/dev/null 2>&1; then dnf update -y dnf install -y git docker systemctl enable --now dockerfi
# 2. Clone the repositorymkdir -p /opt/bugfix-agentcd /opt/bugfix-agentif [ ! -d ".git" ]; then git clone https://github.com/farazmalik180/autonomous-bug-fixing-agent.git .else git pull origin mainfi
# 3. Create .env (replace GROQ_API_KEY below or set in UI)cat <<EOF > .envGROQ_API_KEY=${GROQ_API_KEY:-}GROQ_MODEL=openai/gpt-oss-120bSANDBOX_BACKEND=dockerEOF
# 4. Build the inner Docker sandbox image so tests run in isolated containers on EC2docker build -t bugfix-agent-sandbox:latest src/sandbox || true
# 5. Build and run the Streamlit app container on port 80 and 8501docker build -t bugfix-agent-web:latest .docker rm -f bugfix-agent-web || truedocker run -d \ --name bugfix-agent-web \ --restart unless-stopped \ -p 80:8501 \ -p 8501:8501 \ --env-file /opt/bugfix-agent/.env \ -v /var/run/docker.sock:/var/run/docker.sock \ bugfix-agent-web:latest123456789101112services: bugfix-agent: build: . container_name: autonomous-bug-fixing-agent restart: unless-stopped ports: - "80:8501" - "8501:8501" env_file: - .env environment: - SANDBOX_BACKEND=localDockerfileAdded+27
deploy/ec2_userdata.shAdded+45
docker-compose.ymlAdded+12