Docker provides a streamlined and efficient method for managing containerized applications, making it an ideal choice for deploying this project.
- 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.
-
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:
git clone https://github.com/cgoinglove/better-chatbot cd better-chatbot -
Set up Environment Variables: Run
pnpm initial:envto generate the.envfile.
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 secretFor the database, Docker will handle all necessary configuration automatically,
so the defaultdocker/.envfile is sufficient. -
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):
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 belocalhostif you're running it on your local machine).
If you don't want to host your own db, here are some steps
- Open up your docker compose file.
docker/compose.ymlComment out the postgres section and the volume - Update
.envchange your DB url - Migrate the DB
pnpm db:migrate- Run the app
pnpm docker-compose:up- 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.
To stop the running container, ensure you are in the project's root directory and execute:
pnpm docker-compose:downTo update the application to the latest version:
pnpm docker-compose:update