2023-11-20 19:56:06 -08:00
|
|
|
<!-- DANSWER_METADATA={"link": "https://github.com/danswer-ai/danswer/blob/main/deployment/README.md"} -->
|
|
|
|
|
2023-06-14 00:11:25 -07:00
|
|
|
# Deploying Danswer
|
|
|
|
The two options provided here are the easiest ways to get Danswer up and running.
|
2023-05-05 16:48:36 -07:00
|
|
|
|
2023-06-14 00:11:25 -07:00
|
|
|
- Docker Compose is simpler and default values are already preset to run right out of the box with a single command.
|
|
|
|
As everything is running on a single machine, this may not be as scalable depending on your hardware, traffic and needs.
|
2023-05-16 20:25:16 -07:00
|
|
|
|
2023-06-14 00:11:25 -07:00
|
|
|
- Kubernetes deployment is also provided. Depending on your existing infrastructure, this may be more suitable for
|
|
|
|
production deployment but there are a few caveats.
|
|
|
|
- User auth is turned on by default for Kubernetes (with the assumption this is for production use)
|
|
|
|
so you must either update the deployments to turn off user auth or provide the values shown in the example
|
|
|
|
secrets.yaml file.
|
|
|
|
- The example provided assumes a blank slate for existing Kubernetes deployments/services. You may need to adjust the
|
|
|
|
deployments or services according to your setup. This may require existing Kubernetes knowledge or additional
|
|
|
|
setup time.
|
2023-05-16 20:25:16 -07:00
|
|
|
|
2023-06-14 00:11:25 -07:00
|
|
|
All the features of Danswer are fully available regardless of the deployment option.
|
2023-05-16 20:25:16 -07:00
|
|
|
|
2023-06-14 00:11:25 -07:00
|
|
|
For information on setting up connectors, check out https://docs.danswer.dev/connectors/overview
|
2023-05-16 20:25:16 -07:00
|
|
|
|
|
|
|
|
2023-06-14 00:11:25 -07:00
|
|
|
## Docker Compose:
|
|
|
|
Docker Compose provides the easiest way to get Danswer up and running.
|
2023-05-30 19:59:57 -07:00
|
|
|
|
2023-06-14 00:11:25 -07:00
|
|
|
Requirements: Docker and docker compose
|
2023-05-30 19:59:57 -07:00
|
|
|
|
2023-06-14 00:11:25 -07:00
|
|
|
1. To run Danswer, navigate to `docker_compose` directory and run the following:
|
2023-07-08 15:53:21 -07:00
|
|
|
- `docker compose -f docker-compose.dev.yml -p danswer-stack up -d --pull always --force-recreate`
|
|
|
|
- or run: `docker compose -f docker-compose.dev.yml -p danswer-stack up -d --build --force-recreate`
|
|
|
|
to build from source
|
|
|
|
- Downloading images or packages/requirements may take 15+ minutes depending on your internet connection.
|
2023-06-14 00:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
2. To shut down the deployment, run:
|
|
|
|
- To stop the containers: `docker compose -f docker-compose.dev.yml -p danswer-stack stop`
|
|
|
|
- To delete the containers: `docker compose -f docker-compose.dev.yml -p danswer-stack down`
|
|
|
|
|
|
|
|
|
|
|
|
3. To completely remove Danswer run:
|
|
|
|
- **WARNING, this will also erase your indexed data and users**
|
|
|
|
- `docker compose -f docker-compose.dev.yml -p danswer-stack down -v`
|
|
|
|
|
|
|
|
|
|
|
|
Additional steps for user auth and https if you do want to use Docker Compose for production:
|
2023-05-30 19:59:57 -07:00
|
|
|
|
|
|
|
1. Set up a `.env` file in this directory with relevant environment variables.
|
2023-07-01 15:16:51 -07:00
|
|
|
- Refer to `env.prod.template`
|
2023-06-14 00:11:25 -07:00
|
|
|
- To turn on user auth, set:
|
|
|
|
- GOOGLE_OAUTH_CLIENT_ID=\<your GCP API client ID\>
|
|
|
|
- GOOGLE_OAUTH_CLIENT_SECRET=\<associated client secret\>
|
|
|
|
- Refer to https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid
|
2023-05-30 19:59:57 -07:00
|
|
|
|
|
|
|
2. Set up https:
|
|
|
|
- Set up a `.env.nginx` file in this directory based on `env.nginx.template`.
|
|
|
|
- `chmod +x init-letsencrypt.sh` + `./init-letsencrypt.sh` to set up https certificate.
|
|
|
|
|
|
|
|
3. Follow the above steps but replacing dev with prod.
|
2023-06-14 00:11:25 -07:00
|
|
|
|
|
|
|
|
|
|
|
## Kubernetes:
|
|
|
|
Depending on your deployment needs Kubernetes may be more suitable. The yamls provided will work out of the box but the
|
|
|
|
intent is for you to customize the deployment to fit your own needs. There is no data replication or auto-scaling built
|
|
|
|
in for the provided example.
|
|
|
|
|
|
|
|
Requirements: a Kubernetes cluster and kubectl
|
|
|
|
|
|
|
|
**NOTE: This setup does not explicitly enable https, the assumption is you would have this already set up for your
|
|
|
|
prod cluster**
|
|
|
|
|
|
|
|
1. To run Danswer, navigate to `kubernetes` directory and run the following:
|
|
|
|
- `kubectl apply -f .`
|
|
|
|
|
|
|
|
2. To remove Danswer, run:
|
2023-06-14 00:41:26 -07:00
|
|
|
- **WARNING, this will also erase your indexed data and users**
|
2023-06-14 00:11:25 -07:00
|
|
|
- `kubectl delete -f .`
|
|
|
|
- To not delete the persistent volumes (Document indexes and Users), specify the specific `.yaml` files instead of
|
2023-06-14 00:41:26 -07:00
|
|
|
`.` without specifying delete on persistent-volumes.yaml.
|