-
Notifications
You must be signed in to change notification settings - Fork 577
feat: Add Docker containerization for secure, isolated execution #179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
webdevcody
merged 3 commits into
AutoMaker-Org:main
from
illia1f:feature/isolated-docker-compose
Dec 20, 2025
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -78,3 +78,5 @@ blob-report/ | |
|
|
||
| # Misc | ||
| *.pem | ||
|
|
||
| docker-compose.override.yml | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Automaker UI | ||
| # Multi-stage build for minimal production image | ||
|
|
||
| # Build stage | ||
| FROM node:20-alpine AS builder | ||
|
|
||
| # Install build dependencies | ||
| RUN apk add --no-cache python3 make g++ | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Copy package files | ||
| COPY package*.json ./ | ||
| COPY apps/ui/package*.json ./apps/ui/ | ||
| COPY scripts ./scripts | ||
|
|
||
| # Install dependencies (skip electron postinstall) | ||
| RUN npm ci --workspace=apps/ui --ignore-scripts | ||
|
|
||
| # Copy source | ||
| COPY apps/ui ./apps/ui | ||
|
|
||
| # Build for web (skip electron) | ||
| # VITE_SERVER_URL tells the UI where to find the API server | ||
| # Using localhost:3008 since both containers expose ports to the host | ||
| # Use ARG to allow overriding at build time: --build-arg VITE_SERVER_URL=http://api.example.com | ||
| ARG VITE_SERVER_URL=http://localhost:3008 | ||
| ENV VITE_SKIP_ELECTRON=true | ||
| ENV VITE_SERVER_URL=${VITE_SERVER_URL} | ||
| RUN npm run build --workspace=apps/ui | ||
|
|
||
| # Production stage - serve with nginx | ||
| FROM nginx:alpine | ||
|
|
||
| # Copy built files | ||
| COPY --from=builder /app/apps/ui/dist /usr/share/nginx/html | ||
|
|
||
| # Copy nginx config for SPA routing | ||
| COPY apps/ui/nginx.conf /etc/nginx/conf.d/default.conf | ||
|
|
||
| EXPOSE 80 | ||
|
|
||
| CMD ["nginx", "-g", "daemon off;"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| server { | ||
| listen 80; | ||
| server_name localhost; | ||
| root /usr/share/nginx/html; | ||
| index index.html; | ||
|
|
||
| location / { | ||
| try_files $uri $uri/ /index.html; | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| services: | ||
| server: | ||
| volumes: | ||
| # Mount your workspace directory to /projects inside the container | ||
| - /Users/webdevcody/Workspace/automaker-workspace:/projects:rw | ||
| environment: | ||
| # Set workspace directory so the UI can discover projects | ||
| - WORKSPACE_DIR=/projects | ||
| # Ensure /projects is in allowed directories | ||
| - ALLOWED_PROJECT_DIRS=/projects |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # Docker Isolation Guide | ||
|
|
||
| This guide covers running Automaker in a fully isolated Docker container. For background on why isolation matters, see the [Security Disclaimer](../DISCLAIMER.md). | ||
|
|
||
| ## Quick Start | ||
|
|
||
| 1. **Set your API key** (create a `.env` file in the project root): | ||
|
|
||
| ```bash | ||
| # Linux/Mac | ||
| echo "ANTHROPIC_API_KEY=your-api-key-here" > .env | ||
|
|
||
| # Windows PowerShell | ||
| Set-Content -Path .env -Value "ANTHROPIC_API_KEY=your-api-key-here" -Encoding UTF8 | ||
| ``` | ||
|
|
||
| 2. **Build and run**: | ||
|
|
||
| ```bash | ||
| docker-compose up -d | ||
| ``` | ||
|
|
||
| 3. **Access Automaker** at `http://localhost:3007` | ||
|
|
||
| 4. **Stop**: | ||
|
|
||
| ```bash | ||
| docker-compose down | ||
| ``` | ||
|
|
||
| ## How Isolation Works | ||
|
|
||
| The default `docker-compose.yml` configuration: | ||
|
|
||
| - Uses only Docker-managed volumes (no host filesystem access) | ||
| - Server runs as a non-root user | ||
| - Has no privileged access to your system | ||
|
|
||
| Projects created in the UI are stored inside the container at `/projects` and persist across restarts via Docker volumes. | ||
illia1f marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| ## Mounting a Specific Project | ||
|
|
||
| If you need to work on a host project, create `docker-compose.project.yml`: | ||
|
|
||
| ```yaml | ||
| services: | ||
| server: | ||
| volumes: | ||
| - ./my-project:/projects/my-project:ro # :ro = read-only | ||
| ``` | ||
|
|
||
| Then run: | ||
|
|
||
| ```bash | ||
| docker-compose -f docker-compose.yml -f docker-compose.project.yml up -d | ||
| ``` | ||
|
|
||
| **Tip**: Use `:ro` (read-only) when possible for extra safety. | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| | Problem | Solution | | ||
| | --------------------- | -------------------------------------------------------------------------------------------- | | ||
| | Container won't start | Check `.env` has `ANTHROPIC_API_KEY` set. Run `docker-compose logs` for errors. | | ||
| | Can't access web UI | Verify container is running with `docker ps \| grep automaker` | | ||
| | Need a fresh start | Run `docker-compose down && docker volume rm automaker-data && docker-compose up -d --build` | | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.