Spaces:
Sleeping
Sleeping
File size: 2,478 Bytes
05c5ed5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 | # Using Docker
Docker provides a streamlined and efficient method for managing containerized applications, making it an ideal choice for deploying this project.
## Requirements
- **Architecture:** An x86-64 or ARM(64) based computer.
- **Operating System:** Linux, macOS (with Docker Desktop or equivalent), or Windows (with WSL).
- **Software:** Docker and Docker Compose installed and configured.
## Steps
1. **Clone the Repository:**
Navigate to the desired directory in your terminal and clone the project repository. If you're not already in the project directory after cloning, change into it:
```sh
git clone https://github.com/cgoinglove/better-chatbot
cd better-chatbot
```
2. **Set up Environment Variables:**
Run `pnpm initial:env` to generate the `.env` file.
Then, enter the API keys only for the LLM providers you plan to use.
You can generate an authentication secret (`BETTER_AUTH_SECRET`) with the command:
`pnpx auth secret`
For the database, Docker will handle all necessary configuration automatically,
so the default `docker/.env` file is sufficient.
1. **Build and Start the Container:**
From the project's root directory, build the Docker image and start the container in detached mode (running in the background):
```sh
pnpm docker-compose:up
```
Your application should now be running. You can access it by visiting `http://<ipofserver>:3000/` in your web browser. Replace `<ipofserver>` with the IP address of the server where Docker is running (this will likely be `localhost` if you're running it on your local machine).
## Using your own database
If you don't want to host your own db, here are some steps
1. Open up your docker compose file. `docker/compose.yml`
Comment out the postgres section and the volume
2. Update `.env` change your DB url
3. Migrate the DB
```sh
pnpm db:migrate
```
4. Run the app
```sh
pnpm docker-compose:up
```
## What is possible in docker and what is not
- Full support for MCP stdio servers that work with bunx, uvx and npx.
- Full support for SSE,Streamable Remote servers.
- And everything else as you would expect.
## Managing the Container
### Stopping the Container
To stop the running container, ensure you are in the project's root directory and execute:
```sh
pnpm docker-compose:down
```
### Updating the Application
To update the application to the latest version:
```sh
pnpm docker-compose:update
```
|