This repo contains a local backend service plus an AI-powered Dockerfile generator (dockerizer-agent). The backend accepts a project zip, generates a Dockerfile using an agentic approach with Gemini (the AI iteratively explores your project using tools), builds a Docker image, pushes it to Artifact Registry, and deploys it to Google Cloud Run.
- Python 3.10+
- Docker Desktop (or Docker Engine) running locally
- Node.js 18+ (for the VS Code extension)
- Google Cloud billing account (for deployment)
- A GCP project with billing linked (Cloud Run + Artifact Registry can be auto-enabled during deploy)
- Gemini API key for Dockerfile generation
- Create and activate a virtual environment:
python -m venv .venv
.\.venv\Scripts\activate- Install backend dependencies:
python -m pip install -r requirements.txt
python -m pip install -e dockerizer-agent- Create a
.envfile in the repo root with:
GEMINI_API_KEY=your-gemini-api-key
GCP_OAUTH_CLIENT_ID=your-oauth-client-id
GCP_OAUTH_CLIENT_SECRET=your-oauth-client-secret
GCP_OAUTH_CLIENT_SECRET is optional for true Desktop OAuth clients. If you still get
client_secret is missing, add the secret here and the extension will load it from the backend.
The extension prefers backend .env OAuth values over built-in defaults unless VS Code settings are set.
- Start the backend server:
python -m uvicorn backend.app:app --reload- In a new cmd window, set up the extension:
cd vscode-extension
npm install
npm run compile
code .-
In VS Code, press
F5to open the Extension Development Host window. -
In the Extension Development Host window:
- Open Command Palette (
Ctrl+Shift+P) - Run
Agent Deploy: Open - Click Sign in with Google
- Create a GCP project (if needed), link billing, and copy the Project ID
- Fill in
GCP Project ID,Cloud Run Service, and region - (Optional) Add runtime env vars to pass API keys to Cloud Run
- Pick a project folder and click Deploy
- Open Command Palette (
- Create and activate a virtual environment:
python3 -m venv .venv
source .venv/bin/activate- Install backend dependencies:
python -m pip install -r requirements.txt
python -m pip install -e dockerizer-agent- Create a
.envfile in the repo root with:
GEMINI_API_KEY=your-gemini-api-key
GCP_OAUTH_CLIENT_ID=your-oauth-client-id
GCP_OAUTH_CLIENT_SECRET=your-oauth-client-secret
- Start the backend server:
python -m uvicorn backend.app:app --reload- In a new terminal, set up the extension:
cd vscode-extension
npm install
npm run compile
code .-
In VS Code, press
F5to open the Extension Development Host window. -
In the Extension Development Host window:
- Open Command Palette (
Cmd+Shift+P) - Run
Agent Deploy: Open - Click Sign in with Google
- Create a GCP project (if needed), link billing, and copy the Project ID
- Fill in
GCP Project ID,Cloud Run Service, and region - (Optional) Add runtime env vars to pass API keys to Cloud Run
- Pick a project folder and click Deploy
- Open Command Palette (
You can override defaults in VS Code settings:
agentDeploy.backendUrl(defaulthttp://127.0.0.1:8000)agentDeploy.gcpClientId(optional override for Google OAuth client ID)agentDeploy.gcpClientSecret(only needed if you created a Web OAuth client)agentDeploy.gcpRegion(defaultasia-southeast1) If you prefer no VS Code settings, putGCP_OAUTH_CLIENT_IDandGCP_OAUTH_CLIENT_SECRETin the backend.envand the extension will fetch them automatically.
If you want to hit the backend directly:
- Get an access token:
gcloud auth login
gcloud auth print-access-token- Call the backend:
curl -X POST http://127.0.0.1:8000/jobs \
-F "project_zip=@/path/to/project.zip" \
-F "access_token=YOUR_ACCESS_TOKEN" \
-F "project_id=YOUR_PROJECT_ID" \
-F "service_name=YOUR_SERVICE_NAME" \
-F "region=asia-southeast1" \
-F "env_vars=[{\"name\":\"API_KEY\",\"value\":\"secret\"}]"- Zips are kept for now under
backend/data/uploads. - Work directories are stored under
backend/data/work. - Cloud Run service names must be lowercase and start with a letter.
- For solo devs with their own billing account, the flow is: create project + link billing, sign in, enter project ID, deploy.
If you see ImportError: cannot import name 'genai' from 'google', fix the environment:
Windows (cmd):
python -m pip uninstall -y google
python -m pip install -U google-genai
python -m pip install -r requirements.txt
python -m pip install -e dockerizer-agent
python -m uvicorn backend.app:app --reloadIf you see client_secret is missing during Google sign-in:
- Rebuild the extension:
npm run compile - Preferred: add to
.env:
GCP_OAUTH_CLIENT_ID=YOUR_CLIENT_ID
GCP_OAUTH_CLIENT_SECRET=YOUR_CLIENT_SECRET
- Alternative: set in User Settings (JSON):
"agentDeploy.gcpClientId": "YOUR_CLIENT_ID",
"agentDeploy.gcpClientSecret": "YOUR_CLIENT_SECRET"- Reload the Extension Development Host and sign in again.
If deployment fails with SERVICE_DISABLED for Artifact Registry or Cloud Run:
- The backend now auto-enables these APIs during deploy (if the user has permission).
- Wait a minute for propagation and retry.
If deployment fails with a billing error:
- Link a billing account to the target project, then retry.