【笔记】AI Agent 项目 SUNA 部署 之 Docker 构建记录

发布于:2025-06-10 ⋅ 阅读:(23) ⋅ 点赞:(0)

#工作记录

构建过程记录

Microsoft Windows [Version 10.0.27871.1000]
(c) Microsoft Corporation. All rights reserved.

(suna-py3.12) F:\PythonProjects\suna>python setup.py '--admin'


   ███████╗██╗   ██╗███╗   ██╗ █████╗ 
   ██╔════╝██║   ██║████╗  ██║██╔══██╗
   ███████╗██║   ██║██╔██╗ ██║███████║
   ╚════██║██║   ██║██║╚██╗██║██╔══██║
   ███████║╚██████╔╝██║ ╚████║██║  ██║
   ╚══════╝ ╚═════╝ ╚═╝  ╚═══╝╚═╝  ╚═╝
                                      
   Setup Wizard


This wizard will guide you through setting up Suna, an open-source generalist AI agent.


Step 8/8: Installing dependencies
==================================================

ℹ️  Installing required dependencies...
ℹ️  Installing frontend dependencies...

up to date in 4s

292 packages are looking for funding
  run `npm fund` for details
✅  Frontend dependencies installed successfully
ℹ️  Locking dependencies...
Resolving dependencies... (0.4s)
ℹ️  Installing backend dependencies...
Installing dependencies from lock file

No dependencies to install or update

Installing the current project: suna (1.0)
✅  Backend dependencies installed successfully
ℹ️  Configuring environment files...
✅  Backend .env file created at backend\.env
ℹ️  Redis host is set to: redis
ℹ️  RabbitMQ host is set to: rabbitmq
✅  Frontend .env.local file created at frontend\.env.local
ℹ️  Backend URL is set to: http://localhost:8000/api

Step 8/8: Starting Suna
==================================================

ℹ️  You can start Suna using either Docker Compose or by manually starting the frontend, backend and worker.

How would you like to start Suna?
[1] Docker Compose (recommended, starts all services)                                                                                                                                                                                                                                                           
[2] Manual startup (requires Redis, RabbitMQ & separate terminals)                                                                                                                                                                                                                                              

Enter your choice (1 or 2): 1
ℹ️  Starting Suna with Docker Compose...
ℹ️  Building images locally...
Compose can now delegate builds to bake for better performance.
 To do so, set COMPOSE_BAKE=true.
[+] Building 2405.1s (34/34) FINISHED                                                                                                                                                                                                                                                      docker:desktop-linux
 => [worker internal] load build definition from Dockerfile                                                                                                                                                                                                                                                0.0s
 => => transferring dockerfile: 1.63kB                                                                                                                                                                                                                                                                     0.0s 
 => [backend internal] load metadata for docker.io/library/python:3.11-slim                                                                                                                                                                                                                                5.0s 
 => [worker internal] load .dockerignore                                                                                                                                                                                                                                                                   0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                            0.0s 
 => [backend 1/7] FROM docker.io/library/python:3.11-slim@sha256:7a3ed1226224bcc1fe5443262363d42f48cf832a540c1836ba8ccbeaadf8637c                                                                                                                                                                          0.1s 
 => => resolve docker.io/library/python:3.11-slim@sha256:7a3ed1226224bcc1fe5443262363d42f48cf832a540c1836ba8ccbeaadf8637c                                                                                                                                                                                  0.0s 
 => [worker internal] load build context                                                                                                                                                                                                                                                                   0.0s 
 => => transferring context: 13.85kB                                                                                                                                                                                                                                                                       0.0s 
 => CACHED [backend 2/7] WORKDIR /app                                                                                                                                                                                                                                                                      0.0s 
 => CACHED [backend 3/7] RUN apt-get update && apt-get install -y --no-install-recommends     build-essential     curl     && rm -rf /var/lib/apt/lists/*                                                                                                                                                  0.0s 
 => CACHED [backend 4/7] RUN useradd -m -u 1000 appuser &&     mkdir -p /app/logs &&     chown -R appuser:appuser /app                                                                                                                                                                                     0.0s 
 => [worker 5/7] COPY --chown=appuser:appuser requirements.txt .                                                                                                                                                                                                                                           0.0s 
 => [worker 6/7] RUN pip install --no-cache-dir -r requirements.txt gunicorn                                                                                                                                                                                                                            2203.4s
 => [worker 7/7] COPY --chown=appuser:appuser . .                                                                                                                                                                                                                                                          0.3s
 => [worker] exporting to image                                                                                                                                                                                                                                                                           16.3s
 => => exporting layers                                                                                                                                                                                                                                                                                   12.7s
 => => exporting manifest sha256:5b60e25aecb12bb49c3aac4e01cc5c2413648fa5ab37e7299746febb464d745d                                                                                                                                                                                                          0.0s
 => => exporting config sha256:0caef4d86ad141e08e01e14e89633e050352c7160021960c1c09241311c87ef6                                                                                                                                                                                                            0.0s
 => => exporting attestation manifest sha256:5911feea3dad786ac47ac662eac6eb944529dbc0a467cc8ed060f303c3e93e5b                                                                                                                                                                                              0.0s
 => => exporting manifest list sha256:3e0e4195f36d516b3816f8b0dab23140f98d8f7b0bcac6739f364c6ddec789f2                                                                                                                                                                                                     0.0s
 => => naming to docker.io/library/suna-worker:latest                                                                                                                                                                                                                                                      0.0s 
 => => unpacking to docker.io/library/suna-worker:latest                                                                                                                                                                                                                                                   3.5s 
 => [worker] resolving provenance for metadata file                                                                                                                                                                                                                                                        0.0s
 => [backend internal] load build definition from Dockerfile                                                                                                                                                                                                                                               0.0s
 => => transferring dockerfile: 1.63kB                                                                                                                                                                                                                                                                     0.0s
 => [backend internal] load .dockerignore                                                                                                                                                                                                                                                                  0.0s
 => => transferring context: 2B                                                                                                                                                                                                                                                                            0.0s 
 => [backend internal] load build context                                                                                                                                                                                                                                                                  0.1s 
 => => transferring context: 11.44kB                                                                                                                                                                                                                                                                       0.1s 
 => CACHED [backend 5/7] COPY --chown=appuser:appuser requirements.txt .                                                                                                                                                                                                                                   0.0s
 => CACHED [backend 6/7] RUN pip install --no-cache-dir -r requirements.txt gunicorn                                                                                                                                                                                                                       0.0s 
 => CACHED [backend 7/7] COPY --chown=appuser:appuser . .                                                                                                                                                                                                                                                  0.0s 
 => [backend] exporting to image                                                                                                                                                                                                                                                                           0.1s 
 => => exporting layers                                                                                                                                                                                                                                                                                    0.0s 
 => => exporting manifest sha256:28615a4753366aec577ed08ec7d7a89a2971cb9f86c76255eba4cffc98a63b6b                                                                                                                                                                                                          0.0s 
 => => exporting config sha256:fe686a779f6c5cd81f1b8c254cce2e78512dd1151bfbd5ccb3feaf1638da58a1                                                                                                                                                                                                            0.0s 
 => => exporting attestation manifest sha256:286690b2fae713e8c675078e9420ad745032efc209cd9b6d0ff52a1353a91a4b                                                                                                                                                                                              0.0s 
 => => exporting manifest list sha256:c9996a7112b93034e5e7dfcaccf2dac37eb5a74fb4c6fb2d731b597ffb2770b7                                                                                                                                                                                                     0.0s 
 => => naming to docker.io/library/suna-backend:latest                                                                                                                                                                                                                                                     0.0s
 => => unpacking to docker.io/library/suna-backend:latest                                                                                                                                                                                                                                                  0.0s 
 => [backend] resolving provenance for metadata file                                                                                                                                                                                                                                                       0.0s 
 => [frontend internal] load build definition from Dockerfile                                                                                                                                                                                                                                              0.0s 
 => => transferring dockerfile: 704B                                                                                                                                                                                                                                                                       0.0s 
 => [frontend internal] load metadata for docker.io/library/node:20-slim                                                                                                                                                                                                                                   2.3s 
 => [frontend internal] load .dockerignore                                                                                                                                                                                                                                                                 0.0s 
 => => transferring context: 2B                                                                                                                                                                                                                                                                            0.0s 
 => [frontend 1/7] FROM docker.io/library/node:20-slim@sha256:cb4abfbba7dfaa78e21ddf2a72a592e5f9ed36ccf98bdc8ad3ff945673d288c2                                                                                                                                                                             0.0s 
 => => resolve docker.io/library/node:20-slim@sha256:cb4abfbba7dfaa78e21ddf2a72a592e5f9ed36ccf98bdc8ad3ff945673d288c2                                                                                                                                                                                      0.0s 
 => [frontend internal] load build context                                                                                                                                                                                                                                                                11.3s 
 => => transferring context: 8.70MB                                                                                                                                                                                                                                                                       10.6s 
 => CACHED [frontend 2/7] WORKDIR /app                                                                                                                                                                                                                                                                     0.0s 
 => CACHED [frontend 3/7] COPY package*.json ./                                                                                                                                                                                                                                                            0.0s 
 => CACHED [frontend 4/7] RUN apt-get update && apt-get install -y --no-install-recommends     python3     make     g++     build-essential     pkg-config     libcairo2-dev     libpango1.0-dev     libjpeg-dev     libgif-dev     librsvg2-dev     && rm -rf /var/lib/apt/lists/*                        0.0s 
 => CACHED [frontend 5/7] RUN npm install                                                                                                                                                                                                                                                                  0.0s 
 => [frontend 6/7] COPY . .                                                                                                                                                                                                                                                                               33.3s 
 => [frontend 7/7] RUN npm run build                                                                                                                                                                                                                                                                      88.0s 
 => [frontend] exporting to image                                                                                                                                                                                                                                                                         41.7s 
 => => exporting layers                                                                                                                                                                                                                                                                                   32.3s 
 => => exporting manifest sha256:e11438b808ea84b58c682c717acb770ec86e91bf2e4f729e753f9cc62f6197ca                                                                                                                                                                                                          0.0s 
 => => exporting config sha256:fa45c13e02f6722025f58e1327de347b959d3584c798434d26001d798c8f1e4f                                                                                                                                                                                                            0.0s 
 => => exporting attestation manifest sha256:a3ee7b4102a5fab49740cf0a063e8578ccc4effb1d53e25571a4b70b0af2e6d0                                                                                                                                                                                              0.0s 
 => => exporting manifest list sha256:68a86ddb15440e0a3fd59b93927eea0fdbfc89b922bde7c068ce25c36e45fdab                                                                                                                                                                                                     0.0s 
 => => naming to docker.io/library/suna-frontend:latest                                                                                                                                                                                                                                                    0.0s 
 => => unpacking to docker.io/library/suna-frontend:latest                                                                                                                                                                                                                                                 9.3s 
 => [frontend] resolving provenance for metadata file                                                                                                                                                                                                                                                      0.0s 
[+] Running 8/8                                                                                                                                                                                                                                                                                                 
 ✔ backend                    Built                                                                                                                                                                                                                                                                        0.0s 
 ✔ frontend                   Built                                                                                                                                                                                                                                                                        0.0s 
 ✔ worker                     Built                                                                                                                                                                                                                                                                        0.0s 
 ✔ Container suna-redis-1     Healthy                                                                                                                                                                                                                                                                     25.6s 
 ✔ Container suna-rabbitmq-1  Healthy                                                                                                                                                                                                                                                                     25.6s 
 ✔ Container suna-worker-1    Started                                                                                                                                                                                                                                                                     25.1s 
 ✔ Container suna-backend-1   Started                                                                                                                                                                                                                                                                     20.4s 
 ✔ Container suna-frontend-1  Started                                                                                                                                                                                                                                                                     18.9s 
ℹ️  Waiting for services to start...                                                                                                                                                                                                                                                                            
⚠️  Some services might not be running correctly. Check 'docker compose ps' for details.                                                                                                                                                                                                                        

✨ Suna Setup Complete! ✨

ℹ️  Suna is configured to use openrouter/openai/gpt-4o-2024-11-20 as the default LLM model
ℹ️  Your Suna instance is now running!                                                                                                                                                                                                                                                                          
ℹ️  Access it at: http://localhost:3000                                                                                                                                                                                                                                                                         
ℹ️  Create an account using Supabase authentication to start using Suna                                                                                                                                                                                                                                         

Useful Docker commands:
  docker compose ps         - Check the status of Suna services
  docker compose logs       - View logs from all services
  docker compose logs -f    - Follow logs from all services
  docker compose down       - Stop Suna services
  docker compose up -d      - Start Suna services (after they've been stopped)

(suna-py3.12) F:\PythonProjects\suna>

点击输出中显示的链接访问:

ℹ️  Access it at: http://localhost:3000