mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-04 09:38:50 +01:00
🐳 docs: update to compose v2 (#1767)
This commit is contained in:
parent
a91042b6b9
commit
5ccdec730b
12 changed files with 45 additions and 45 deletions
|
|
@ -66,7 +66,7 @@ The example config file has some options ready to go for Mistral AI and Openrout
|
|||
|
||||
For Docker, you need to make use of an [override file](./docker_override.md), named `docker-compose.override.yml`, to ensure the config file works for you.
|
||||
|
||||
- First, make sure your containers stop running with `docker-compose down`
|
||||
- First, make sure your containers stop running with `docker compose down`
|
||||
- Create or edit existing `docker-compose.override.yml` at the root of the project:
|
||||
|
||||
```yaml
|
||||
|
|
@ -83,7 +83,7 @@ services:
|
|||
|
||||
- Start docker again, and you should see your config file settings apply
|
||||
```bash
|
||||
docker-compose up # no need to rebuild
|
||||
docker compose up # no need to rebuild
|
||||
```
|
||||
|
||||
## Config Structure
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ weight: -9
|
|||
|
||||
# How to Use the Docker Compose Override File
|
||||
|
||||
In Docker Compose, an override file is a powerful feature that allows you to modify the default configuration provided by the main `docker-compose.yml` without the need to directly edit or duplicate the whole file. The primary use of the override file is for local development customizations, and Docker Compose merges the configurations of the `docker-compose.yml` and the `docker-compose.override.yml` files when you run `docker-compose up`.
|
||||
In Docker Compose, an override file is a powerful feature that allows you to modify the default configuration provided by the main `docker-compose.yml` without the need to directly edit or duplicate the whole file. The primary use of the override file is for local development customizations, and Docker Compose merges the configurations of the `docker-compose.yml` and the `docker-compose.override.yml` files when you run `docker compose up`.
|
||||
|
||||
Here's a quick guide on how to use the `docker-compose.override.yml`:
|
||||
|
||||
|
|
@ -66,14 +66,14 @@ services:
|
|||
To apply your configuration changes, simply run Docker Compose as usual. Docker Compose automatically takes into account both the `docker-compose.yml` and the `docker-compose.override.yml` files:
|
||||
|
||||
```bash
|
||||
docker-compose up -d
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
If you want to invoke a build with the changes before starting containers:
|
||||
|
||||
```bash
|
||||
docker-compose build
|
||||
docker-compose up -d
|
||||
docker compose build
|
||||
docker compose up -d
|
||||
```
|
||||
|
||||
## Step 4: Verify the changes
|
||||
|
|
@ -110,8 +110,8 @@ Use of the `docker-compose.override.yml` file allows us to enable explicit authe
|
|||
First, we must stop the default containers from running, and only run the mongodb container.
|
||||
|
||||
```bash
|
||||
docker-compose down
|
||||
docker-compose up -d mongodb
|
||||
docker compose down
|
||||
docker compose up -d mongodb
|
||||
```
|
||||
|
||||
> Note: The `-d` flag detaches the current terminal instance as the container runs in the background. If you would like to see the mongodb log outputs, omit it and continue in a separate terminal.
|
||||
|
|
@ -205,7 +205,7 @@ admin> exit
|
|||
|
||||
And shut down the running container:
|
||||
```bash
|
||||
docker-compose down
|
||||
docker compose down
|
||||
```
|
||||
|
||||
### Step 2: Enabling Authentication and Creating a User with `readWrite` Access
|
||||
|
|
@ -226,7 +226,7 @@ services:
|
|||
After configuring the override file as above, run the mongodb container again:
|
||||
|
||||
```bash
|
||||
docker-compose up -d mongodb
|
||||
docker compose up -d mongodb
|
||||
```
|
||||
|
||||
And access mongosh as the admin user:
|
||||
|
|
@ -281,16 +281,16 @@ exit
|
|||
```
|
||||
|
||||
```bash
|
||||
docker-compose down
|
||||
docker compose down
|
||||
```
|
||||
|
||||
I had an issue where the newly created user would not persist after creating it. To solve this, I simply repeated the steps to ensure it was created. Here they are for your convenience:
|
||||
|
||||
```bash
|
||||
# ensure container is shut down
|
||||
docker-compose down
|
||||
docker compose down
|
||||
# start mongo container
|
||||
docker-compose up -d mongodb
|
||||
docker compose up -d mongodb
|
||||
# enter mongosh as admin
|
||||
docker exec -it chat-mongodb mongosh -u adminUser -p securePassword --authenticationDatabase admin
|
||||
|
||||
|
|
@ -328,7 +328,7 @@ services:
|
|||
command: mongod --auth
|
||||
```
|
||||
|
||||
You should now run `docker-compose up` successfully authenticated with read/write access to the LibreChat database
|
||||
You should now run `docker compose up` successfully authenticated with read/write access to the LibreChat database
|
||||
|
||||
Example successful connection:
|
||||
```bash
|
||||
|
|
@ -344,24 +344,24 @@ These are all the necessary commands if you'd like to run through these quickly
|
|||
|
||||
```bash
|
||||
# Step 1:
|
||||
docker-compose down
|
||||
docker-compose up -d mongodb
|
||||
docker compose down
|
||||
docker compose up -d mongodb
|
||||
docker exec -it chat-mongodb mongosh
|
||||
use admin
|
||||
db.createUser({ user: "adminUser", pwd: "securePassword", roles: ["userAdminAnyDatabase", "readWriteAnyDatabase"] })
|
||||
exit
|
||||
docker-compose down
|
||||
docker compose down
|
||||
# Step 2:
|
||||
# Edit override file with --auth flag
|
||||
docker-compose up -d mongodb
|
||||
docker compose up -d mongodb
|
||||
docker exec -it chat-mongodb mongosh -u adminUser -p securePassword --authenticationDatabase admin
|
||||
use LibreChat
|
||||
db.createUser({ user: 'user', pwd: 'userpasswd', roles: [ { role: "readWrite", db: "LibreChat" } ] });
|
||||
exit
|
||||
docker-compose down
|
||||
docker compose down
|
||||
# Step 3:
|
||||
# Edit override file with new connection string
|
||||
docker-compose up
|
||||
docker compose up
|
||||
```
|
||||
|
||||
## Example
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ DISCORD_CALLBACK_URL=/oauth/discord/callback
|
|||
|
||||
- Save the `.env` file
|
||||
|
||||
> Note: If using docker, run `docker-compose up -d` to apply the .env configuration changes
|
||||
> Note: If using docker, run `docker compose up -d` to apply the .env configuration changes
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -292,7 +292,7 @@ FACEBOOK_CALLBACK_URL=/oauth/facebook/callback
|
|||
|
||||
- Save the `.env` file.
|
||||
|
||||
> Note: If using docker, run `docker-compose up -d` to apply the .env configuration changes
|
||||
> Note: If using docker, run `docker compose up -d` to apply the .env configuration changes
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -354,7 +354,7 @@ GITHUB_CALLBACK_URL=/oauth/github/callback
|
|||
|
||||
- Save the `.env` file
|
||||
|
||||
> Note: If using docker, run `docker-compose up -d` to apply the .env configuration changes
|
||||
> Note: If using docker, run `docker compose up -d` to apply the .env configuration changes
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -448,7 +448,7 @@ GOOGLE_CALLBACK_URL=/oauth/github/callback
|
|||
|
||||
- Save the `.env` file
|
||||
|
||||
> Note: If using docker, run `docker-compose up -d` to apply the .env configuration changes
|
||||
> Note: If using docker, run `docker compose up -d` to apply the .env configuration changes
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -559,7 +559,7 @@ OPENID_CALLBACK_URL=/oauth/openid/callback
|
|||
```
|
||||
7. Save the .env file
|
||||
|
||||
> Note: If using docker, run `docker-compose up -d` to apply the .env configuration changes
|
||||
> Note: If using docker, run `docker compose up -d` to apply the .env configuration changes
|
||||
|
||||
|
||||
---
|
||||
|
|
@ -590,7 +590,7 @@ OPENID_CALLBACK_URL=/oauth/openid/callback # this should be the same for everyon
|
|||
```
|
||||
11. Save the .env file
|
||||
|
||||
> Note: If using docker, run `docker-compose up -d` to apply the .env configuration changes
|
||||
> Note: If using docker, run `docker compose up -d` to apply the .env configuration changes
|
||||
|
||||
|
||||
---
|
||||
Loading…
Add table
Add a link
Reference in a new issue