mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-31 16:39:48 +00:00
chore(build):Optimize the zsh setup fix(dev):Load .env on demand fix(dev):install oh-my-zsh from mirror
40 lines
1.7 KiB
Docker
40 lines
1.7 KiB
Docker
FROM eosphorosai/dbgpt:latest
|
|
ARG PYTHON_VERSION=3.11
|
|
ARG PIP_INDEX_URL="https://mirrors.aliyun.com/pypi/simple"
|
|
ARG USERNAME
|
|
ARG DEFAULT_VEN=/opt/.uv.venv
|
|
WORKDIR /app
|
|
COPY . .
|
|
USER root
|
|
# Set the GID and UID of the container and
|
|
# add a user to prevent permission mismatches
|
|
# between the container user (root) and the host user,
|
|
# and to resolve the issue of the host user lacking write permissions.
|
|
RUN . .devcontainer/.env && \
|
|
groupadd -g $USER_GID $USERNAME && \
|
|
useradd -u $USER_UID -g $USER_GID -m $USERNAME && \
|
|
chown -R $USER_UID:$USER_GID /app
|
|
RUN apt-get update && apt-get install -y \
|
|
git \
|
|
curl \
|
|
wget \
|
|
ssh zsh autojump curl git-flow vim sudo \
|
|
&& python${PYTHON_VERSION} -m pip install --upgrade pip \
|
|
&& python${PYTHON_VERSION} -m pip install --upgrade pipx \
|
|
&& pipx install -i $PIP_INDEX_URL uv --global \
|
|
&& chown -R $USERNAME:$USERNAME $DEFAULT_VEN \
|
|
&& echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" > /etc/sudoers.d/$USERNAME \
|
|
&& chmod 0440 /etc/sudoers.d/$USERNAME
|
|
USER $USERNAME
|
|
ENV UV_LINK_MODE=copy \
|
|
PIP_INDEX_URL=$PIP_INDEX_URL \
|
|
VIRTUAL_ENV=$DEFAULT_VEN \
|
|
UV_PROJECT_ENVIRONMENT=$DEFAULT_VEN \
|
|
UV_PYTHON=$DEFAULT_VEN/bin/python3
|
|
|
|
RUN . $DEFAULT_VEN/bin/activate && \
|
|
uv pip install --prefix $VIRTUAL_ENV -r pyproject.toml --all-extras --index-url=$PIP_INDEX_URL && \
|
|
uv pip install --prefix $VIRTUAL_ENV -r requirements/dev-requirements.txt --index-url=$PIP_INDEX_URL && \
|
|
uv pip install --prefix $VIRTUAL_ENV -r requirements/lint-requirements.txt --index-url=$PIP_INDEX_URL && \
|
|
cp .devcontainer/dbgpt.pth /opt/.uv.venv/lib/python${PYTHON_VERSION}/site-packages/dbgpt.pth && \
|
|
python -c "import dbgpt; print(dbgpt.__version__)" |