diff --git a/deployment/README.md b/deployment/README.md index dcd78758dac7..00ce9074e847 100644 --- a/deployment/README.md +++ b/deployment/README.md @@ -28,6 +28,8 @@ Requirements: Docker and docker compose - This will start Web/API servers, Postgres (backend DB), Qdrant (vector DB), and the background indexing job. - Downloading packages/requirements may take 20+ minutes depending on your internet connection and whether it needs to install packages for GPU. + - If you want to adjust any environment variables, either use the `-e` flag or the `--env-file` flag when running the `docker compose` command, + 2. To shut down the deployment, run: @@ -43,7 +45,7 @@ Requirements: Docker and docker compose Additional steps for user auth and https if you do want to use Docker Compose for production: 1. Set up a `.env` file in this directory with relevant environment variables. - - Refer to env.dev.template and env.prod.template + - Refer to `env.prod.template` - To turn on user auth, set: - ENABLE_OAUTH=True - GOOGLE_OAUTH_CLIENT_ID=\ diff --git a/deployment/docker_compose/.env b/deployment/docker_compose/.env deleted file mode 100644 index ad768b4ebdfd..000000000000 --- a/deployment/docker_compose/.env +++ /dev/null @@ -1,2 +0,0 @@ -# This empty .env file is provided for compatibility with older Docker/Docker-Compose installations -# To change default values, check env.dev.template or env.prod.template diff --git a/deployment/docker_compose/docker-compose.dev.yml b/deployment/docker_compose/docker-compose.dev.yml index 941b9ea4fc3e..487259e71207 100644 --- a/deployment/docker_compose/docker-compose.dev.yml +++ b/deployment/docker_compose/docker-compose.dev.yml @@ -11,8 +11,6 @@ services: restart: always ports: - "8080:8080" - env_file: - - .env environment: - POSTGRES_HOST=relational_db - QDRANT_HOST=vector_db @@ -30,8 +28,6 @@ services: - relational_db - vector_db restart: always - env_file: - - .env environment: - POSTGRES_HOST=relational_db - QDRANT_HOST=vector_db @@ -47,8 +43,6 @@ services: depends_on: - api_server restart: always - env_file: - - .env environment: - INTERNAL_URL=http://api_server:8080 - DISABLE_AUTH=True @@ -58,17 +52,13 @@ services: environment: - POSTGRES_USER=${POSTGRES_USER:-postgres} - POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-password} - env_file: - - .env ports: - "5432:5432" volumes: - db_volume:/var/lib/postgresql/data vector_db: - image: qdrant/qdrant:v1.1.3 + image: qdrant/qdrant:v1.3.0 restart: always - env_file: - - .env environment: - QDRANT__TELEMETRY_DISABLED=true ports: @@ -81,8 +71,6 @@ services: environment: - TYPESENSE_API_KEY=${TYPESENSE_API_KEY:-local_dev_typesense} - TYPESENSE_DATA_DIR=/typesense/storage - env_file: - - .env ports: - "8108:8108" volumes: diff --git a/deployment/docker_compose/docker-compose.prod.yml b/deployment/docker_compose/docker-compose.prod.yml index 418ce0b83b69..4828c247ba51 100644 --- a/deployment/docker_compose/docker-compose.prod.yml +++ b/deployment/docker_compose/docker-compose.prod.yml @@ -52,12 +52,10 @@ services: # POSTGRES_USER and POSTGRES_PASSWORD should be set in .env file env_file: - .env - ports: - - "5432:5432" volumes: - db_volume:/var/lib/postgresql/data vector_db: - image: qdrant/qdrant:v1.1.3 + image: qdrant/qdrant:v1.3.0 restart: always env_file: - .env @@ -73,8 +71,6 @@ services: - TYPESENSE_DATA_DIR=/typesense/storage env_file: - .env - ports: - - "8108:8108" volumes: - typesense_volume:/typesense/storage nginx: diff --git a/deployment/docker_compose/env.dev.template b/deployment/docker_compose/env.dev.template deleted file mode 100644 index 8c80fdb6be84..000000000000 --- a/deployment/docker_compose/env.dev.template +++ /dev/null @@ -1,8 +0,0 @@ -# Very basic .env file with options that are easy to change. Allows you to deploy everything on a single machine. -# .env is not required unless you wish to change defaults - -# Choose between "openai-chat-completion" and "openai-completion" -INTERNAL_MODEL_VERSION=openai-chat-completion - -# Use a valid model for the choice above, consult https://platform.openai.com/docs/models/model-endpoint-compatibility -OPENAPI_MODEL_VERSION=gpt-3.5-turbo diff --git a/deployment/docker_compose/env.prod.template b/deployment/docker_compose/env.prod.template index efd7917360b2..15b1636abf13 100644 --- a/deployment/docker_compose/env.prod.template +++ b/deployment/docker_compose/env.prod.template @@ -1,5 +1,6 @@ -# Fill in the values and copy the contents of this file to .env in the deployment directory -# Some valid default values are provided where applicable, delete the variables which you don't set values for +# Fill in the values and copy the contents of this file to .env in the deployment directory. +# Some valid default values are provided where applicable, delete the variables which you don't set values for. +# Only applicable when using the docker-compose.prod.yml compose file. # Insert your OpenAI API key here, currently the only Generative AI endpoint for QA that we support is OpenAI @@ -13,8 +14,12 @@ OPENAI_MODEL_VERSION=gpt-4 # Could be something like danswer.companyname.com. Requires additional setup if not localhost WEB_DOMAIN=http://localhost:3000 -# Required -TYPESENSE_API_KEY= +# If you want to make the postgres / typesense instances a little more secure, modify the below +# Note that the postgres / typesense / qdrant containers do not expose any ports to the outside world, +# so they are already unaccessible unless someone has ssh access to the machine that Danswer is running on +POSTGRES_USER=postgres +POSTGRES_PASSWORD=password +TYPESENSE_API_KEY=typesense_api_key # Currently frontend page doesn't have basic auth, use OAuth if user auth is enabled. ENABLE_OAUTH=True