Files
AstrBot/Dockerfile
T
Soulter c2c260b88f feat: ship astrbot CLI in Docker image for in-container password reset
Install the project itself into the image so the `astrbot` console
script (including `astrbot password` and `astrbot conf set`) is
available inside the container, and mark /AstrBot as an initialized
AstrBot root via the .astrbot marker file.

This lets Docker users reset a forgotten dashboard password with:

    docker exec -it astrbot astrbot password

Document the workflow in the zh/en Docker deployment guides, including
the required container restart for the new password to take effect.
2026-10-07 23:15:06 +08:00

38 lines
985 B
Docker

FROM python:3.12-slim
WORKDIR /AstrBot
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
build-essential \
python3-dev \
libffi-dev \
libssl-dev \
ca-certificates \
bash \
ffmpeg \
libavcodec-extra \
fonts-noto-cjk \
curl \
gnupg \
git \
ripgrep \
&& curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY . /AstrBot/
RUN python -m pip install uv \
&& echo "3.12" > .python-version \
&& uv lock \
&& uv export --format requirements.txt --output-file requirements.txt --frozen \
&& uv pip install -r requirements.txt --no-cache-dir --system \
&& uv pip install socksio uv pilk --no-cache-dir --system \
&& uv pip install . --no-deps --no-cache-dir --system \
&& touch /AstrBot/.astrbot
EXPOSE 6185
CMD ["python", "main.py"]