Compare commits

...

9 Commits

Author SHA1 Message Date
Danny Avila
c1f99b41f8 chore: Add RAG_PORT to .env.example 2024-07-09 17:38:35 -04:00
Danny Avila
140feadb7e refactor: Update devcontainer setup and Docker Compose configuration 2024-07-09 17:31:36 -04:00
Danny Avila
7049260709 refactor: Add npm install and other commands to devcontainer setup 2024-07-09 17:12:03 -04:00
Danny Avila
2f6aae6392 chore: Add new scripts for pulling rag and copying example environment file 2024-07-09 17:05:13 -04:00
Danny Avila
c3822fdd28 refactor: Fix indentation in docker-compose.yml 2024-07-09 15:58:05 -04:00
Danny Avila
404cd3e468 refactor: Add sudo permissions for vscode user in devcontainer setup 2024-07-09 15:52:25 -04:00
Danny Avila
0cab0437ad refactor: moby false 2024-07-09 15:35:14 -04:00
Danny Avila
a950f57ee6 refactor: split docker install with env 2024-07-09 15:25:07 -04:00
Danny Avila
104dc9a08e refactor: Add Docker and Docker Compose installation to devcontainer setup 2024-07-09 15:25:07 -04:00
6 changed files with 63 additions and 21 deletions

View File

@@ -0,0 +1,2 @@
# When running devcontainers, you can specify if docker & docker-compose should be installed in your environment
INSTALL_DOCKER=false

View File

@@ -1,5 +1,33 @@
# .devcontainer/Dockerfile
FROM node:18-bullseye
ARG INSTALL_DOCKER="false"
ENV INSTALL_DOCKER=${INSTALL_DOCKER}
# Install Docker and Docker Compose only if INSTALL_DOCKER is "true"
RUN if [ "$INSTALL_DOCKER" = "true" ]; then \
apt-get update && \
apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release && \
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg && \
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null && \
apt-get update && \
apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin; \
fi
# Install sudo
RUN apt-get update && apt-get install -y sudo
# Set up non-root user
RUN useradd -m -s /bin/bash vscode
RUN mkdir -p /workspaces && chown -R vscode:vscode /workspaces
WORKDIR /workspaces
RUN if [ "$INSTALL_DOCKER" = "true" ]; then usermod -aG docker vscode; fi
# Add vscode user to sudoers
RUN echo "vscode ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vscode && \
chmod 0440 /etc/sudoers.d/vscode
USER vscode
WORKDIR /workspaces/LibreChat
# Set the default command
CMD ["/bin/bash"]

View File

@@ -1,18 +1,23 @@
{
"name": "LibreChat Development",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces",
"workspaceFolder": "/workspaces/LibreChat",
"customizations": {
"vscode": {
"extensions": [],
"settings": {
"terminal.integrated.profiles.linux": {
"bash": null
}
}
"extensions": ["ms-azuretools.vscode-docker"]
}
},
"postCreateCommand": "",
"features": { "ghcr.io/devcontainers/features/git:1": {} },
"remoteUser": "vscode"
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {
"version": "latest",
"moby": false,
"dockerDashComposeVersion": "v2"
}
},
"remoteUser": "vscode",
"postCreateCommand": "sudo chown root:docker /var/run/docker.sock && sudo chmod 660 /var/run/docker.sock && npm run reinstall && npm run pull:rag && npm run copy-ex && MEILI_MASTER_KEY=$(docker-compose -f .devcontainer/docker-compose.yml exec -T meilisearch printenv MEILI_MASTER_KEY) && sed -i \"s/^MEILI_MASTER_KEY=.*/MEILI_MASTER_KEY=$MEILI_MASTER_KEY/\" .env",
"remoteEnv": {
"INSTALL_DOCKER": "${localEnv:INSTALL_DOCKER:false}"
}
}

View File

@@ -1,10 +1,16 @@
# .devcontainer/docker-compose.yml
version: "3.8"
services:
app:
build:
group_add:
- docker
build:
context: ..
dockerfile: .devcontainer/Dockerfile
args:
- INSTALL_DOCKER=${INSTALL_DOCKER:-false}
# restart: always
links:
- mongodb
@@ -17,6 +23,7 @@ services:
volumes:
# This is where VS Code should expect to find your project's source code and the value of "workspaceFolder" in .devcontainer/devcontainer.json
- ..:/workspaces:cached
- /var/run/docker.sock:/var/run/docker.sock
# Uncomment the next line to use Docker from inside the container. See https://aka.ms/vscode-remote/samples/docker-from-docker-compose for details.
# - /var/run/docker.sock:/var/run/docker.sock
environment:
@@ -36,14 +43,12 @@ services:
user: vscode
# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"
command: /bin/sh -c "while sleep 1000; do :; done"
mongodb:
container_name: chat-mongodb
expose:
- 27017
# ports:
# - 27018:27017
image: mongo
# restart: always
volumes:
@@ -55,11 +60,8 @@ services:
# restart: always
expose:
- 7700
# Uncomment this to access meilisearch from outside docker
# ports:
# - 7700:7700 # if exposing these ports, make sure your master key is not the default value
environment:
- MEILI_NO_ANALYTICS=true
- MEILI_MASTER_KEY=5c71cf56d672d009e36070b5bc5e47b743535ae55c818ae3b735bb6ebfb4ba63
- MEILI_MASTER_KEY=${MEILI_MASTER_KEY:-$(openssl rand -hex 16)}
volumes:
- ./meili_data_v1.5:/meili_data

View File

@@ -436,3 +436,6 @@ HELP_AND_FAQ_URL=https://librechat.ai
# E2E_USER_EMAIL=
# E2E_USER_PASSWORD=
# RAG_PORT
RAG_PORT=8000

View File

@@ -58,7 +58,9 @@
"b:test:client": "cd client && bun run b:test",
"b:test:api": "cd api && bun run b:test",
"b:balance": "bun config/add-balance.js",
"b:list-balances": "bun config/list-balances.js"
"b:list-balances": "bun config/list-balances.js",
"pull:rag": "docker compose -f ./rag.yml pull",
"copy-ex": "cp .env.example .env"
},
"repository": {
"type": "git",