mirror of https://github.com/kortix-ai/suna.git
Update README and Docker configurations to streamline Redis setup with Docker Compose
This commit is contained in:
parent
2753a4de89
commit
00539ffcf4
15
README.md
15
README.md
|
@ -105,7 +105,10 @@ You'll need the following components:
|
||||||
- [Mac](https://formulae.brew.sh/formula/redis): `brew install redis`
|
- [Mac](https://formulae.brew.sh/formula/redis): `brew install redis`
|
||||||
- [Linux](https://redis.io/docs/getting-started/installation/install-redis-on-linux/): Follow distribution-specific instructions
|
- [Linux](https://redis.io/docs/getting-started/installation/install-redis-on-linux/): Follow distribution-specific instructions
|
||||||
- [Windows](https://redis.io/docs/getting-started/installation/install-redis-on-windows/): Use WSL2 or Docker
|
- [Windows](https://redis.io/docs/getting-started/installation/install-redis-on-windows/): Use WSL2 or Docker
|
||||||
- Save your Redis connection details for later use
|
- Docker Compose (included in our setup):
|
||||||
|
- If you're using our Docker Compose setup, Redis is included and configured automatically
|
||||||
|
- No additional installation is needed
|
||||||
|
- Save your Redis connection details for later use (not needed if using Docker Compose)
|
||||||
|
|
||||||
3. **Daytona**:
|
3. **Daytona**:
|
||||||
- Create an account on [Daytona](https://app.daytona.io/)
|
- Create an account on [Daytona](https://app.daytona.io/)
|
||||||
|
@ -240,6 +243,14 @@ python api.py
|
||||||
|
|
||||||
Before running with Docker Compose, make sure your environment files are properly configured:
|
Before running with Docker Compose, make sure your environment files are properly configured:
|
||||||
- In `backend/.env`, set all the required environment variables as described above
|
- In `backend/.env`, set all the required environment variables as described above
|
||||||
|
- For Redis configuration, use `REDIS_HOST=redis` instead of localhost
|
||||||
|
- The Docker Compose setup will automatically set these Redis environment variables:
|
||||||
|
```
|
||||||
|
REDIS_HOST=redis
|
||||||
|
REDIS_PORT=6379
|
||||||
|
REDIS_PASSWORD=
|
||||||
|
REDIS_SSL=False
|
||||||
|
```
|
||||||
- In `frontend/.env.local`, make sure to set `NEXT_PUBLIC_BACKEND_URL="http://backend:8000/api"` to use the container name
|
- In `frontend/.env.local`, make sure to set `NEXT_PUBLIC_BACKEND_URL="http://backend:8000/api"` to use the container name
|
||||||
|
|
||||||
Then run:
|
Then run:
|
||||||
|
@ -253,6 +264,8 @@ If you're building the images locally instead of using pre-built ones:
|
||||||
docker compose up
|
docker compose up
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The Docker Compose setup includes a Redis service that will be used by the backend automatically.
|
||||||
|
|
||||||
|
|
||||||
7. **Access Suna**:
|
7. **Access Suna**:
|
||||||
- Open your browser and navigate to `http://localhost:3000`
|
- Open your browser and navigate to `http://localhost:3000`
|
||||||
|
|
|
@ -1,6 +1,19 @@
|
||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
volumes:
|
||||||
|
- redis-data:/data
|
||||||
|
command: redis-server --save 60 1 --loglevel warning
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
image: ghcr.io/${GITHUB_REPOSITORY}/suna-backend:latest
|
image: ghcr.io/${GITHUB_REPOSITORY}/suna-backend:latest
|
||||||
ports:
|
ports:
|
||||||
|
@ -9,6 +22,13 @@ services:
|
||||||
- ./backend/.env:/app/.env:ro
|
- ./backend/.env:/app/.env:ro
|
||||||
environment:
|
environment:
|
||||||
- ENV_MODE=local
|
- ENV_MODE=local
|
||||||
|
- REDIS_HOST=redis
|
||||||
|
- REDIS_PORT=6379
|
||||||
|
- REDIS_PASSWORD=
|
||||||
|
- REDIS_SSL=False
|
||||||
|
depends_on:
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
image: ghcr.io/${GITHUB_REPOSITORY}/suna-frontend:latest
|
image: ghcr.io/${GITHUB_REPOSITORY}/suna-frontend:latest
|
||||||
|
@ -17,6 +37,10 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./frontend/.env.local:/app/.env.local:ro
|
- ./frontend/.env.local:/app/.env.local:ro
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
- NODE_ENV=production
|
||||||
|
command: ["npm", "run", "start"]
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
redis-data:
|
|
@ -1,6 +1,19 @@
|
||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
redis:
|
||||||
|
image: redis:7-alpine
|
||||||
|
ports:
|
||||||
|
- "6379:6379"
|
||||||
|
volumes:
|
||||||
|
- redis-data:/data
|
||||||
|
command: redis-server --save 60 1 --loglevel warning
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "redis-cli", "ping"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
|
|
||||||
backend:
|
backend:
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
|
@ -11,6 +24,13 @@ services:
|
||||||
- ./backend/.env:/app/.env:ro
|
- ./backend/.env:/app/.env:ro
|
||||||
environment:
|
environment:
|
||||||
- ENV_MODE=local
|
- ENV_MODE=local
|
||||||
|
- REDIS_HOST=redis
|
||||||
|
- REDIS_PORT=6379
|
||||||
|
- REDIS_PASSWORD=
|
||||||
|
- REDIS_SSL=False
|
||||||
|
depends_on:
|
||||||
|
redis:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
build:
|
build:
|
||||||
|
@ -21,6 +41,10 @@ services:
|
||||||
volumes:
|
volumes:
|
||||||
- ./frontend/.env.local:/app/.env.local:ro
|
- ./frontend/.env.local:/app/.env.local:ro
|
||||||
environment:
|
environment:
|
||||||
- NODE_ENV=development
|
- NODE_ENV=production
|
||||||
|
command: ["npm", "run", "start"]
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
redis-data:
|
|
@ -9,6 +9,10 @@ RUN npm install
|
||||||
# Copy the frontend code
|
# Copy the frontend code
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Build the application
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
||||||
|
# Default command is dev, but can be overridden in docker-compose
|
||||||
CMD ["npm", "run", "dev"]
|
CMD ["npm", "run", "dev"]
|
Loading…
Reference in New Issue