refactor: Add Docker and Docker Compose installation to devcontainer setup

This commit is contained in:
Danny Avila 2024-06-30 17:16:47 -04:00
parent 87bdbda10a
commit 104dc9a08e
No known key found for this signature in database
GPG key ID: 2DD9CC89B9B50364
3 changed files with 23 additions and 8 deletions

View file

@ -1,5 +1,16 @@
FROM node:18-bullseye
RUN useradd -m -s /bin/bash vscode
RUN apt-get update && apt-get install -y sudo
RUN useradd -m -s /bin/bash vscode && echo "vscode ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/vscode
RUN mkdir -p /workspaces && chown -R vscode:vscode /workspaces
WORKDIR /workspaces
# Install Docker and Docker Compose
RUN 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
USER vscode

View file

@ -1,18 +1,21 @@
{
"name": "LibreChat Development",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspaces",
"customizations": {
"vscode": {
"extensions": [],
"extensions": ["ms-azuretools.vscode-docker"],
"settings": {
"terminal.integrated.profiles.linux": {
"bash": null
}
"terminal.integrated.defaultProfile.linux": "bash"
}
}
},
"postCreateCommand": "",
"features": { "ghcr.io/devcontainers/features/git:1": {} },
"remoteUser": "vscode"
"postCreateCommand": "sudo apt-get update && sudo apt-get install -y docker.io docker-compose",
"features": {
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
},
"remoteUser": "vscode",
"forwardPorts": [3080, 27017, 7700]
}

View file

@ -17,6 +17,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: