mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-29 22:58:51 +01:00
refactor: split docker install with env
This commit is contained in:
parent
104dc9a08e
commit
a950f57ee6
4 changed files with 33 additions and 21 deletions
|
|
@ -1,16 +1,22 @@
|
|||
FROM node:18-bullseye
|
||||
|
||||
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
|
||||
ARG INSTALL_DOCKER="false"
|
||||
ENV INSTALL_DOCKER=${INSTALL_DOCKER}
|
||||
|
||||
# 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
|
||||
# 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
|
||||
|
||||
# Set up non-root user
|
||||
RUN useradd -m -s /bin/bash vscode
|
||||
RUN if [ "$INSTALL_DOCKER" = "true" ]; then usermod -aG docker vscode; fi
|
||||
|
||||
USER vscode
|
||||
|
||||
WORKDIR /workspaces
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue