vb: changes for running locally with my own docker image

This commit is contained in:
vbatts 2025-08-01 09:01:34 -04:00 committed by Vincent Batts
parent 10383d526f
commit 51e1f699ad
2 changed files with 35 additions and 1 deletions

30
Dockerfile.local Normal file
View file

@ -0,0 +1,30 @@
FROM r.batts.cloud/nodejs:18 AS frontend-builder
COPY ./maubot/management/frontend /frontend
RUN cd /frontend && yarn --prod && yarn build
#FROM alpine:3.18
FROM r.batts.cloud/debian:bookworm
RUN apt update && \
apt install -y --no-install-recommends python3 python3-dev python3-venv python3-semver git gosu yq brotli && \
apt clean -y && \
rm -rf /var/lib/apt/lists/*
COPY requirements.txt /opt/maubot/requirements.txt
COPY optional-requirements.txt /opt/maubot/optional-requirements.txt
WORKDIR /opt/maubot
RUN python3 -m venv /venv \
&& bash -c 'source /venv/bin/activate \
&& pip3 install -r requirements.txt -r optional-requirements.txt \
dateparser langdetect python-gitlab pyquery tzlocal pyfiglet emoji feedparser brotli'
# TODO also remove pyfiglet, emoji, dateparser, langdetect and pyquery when maubot supports installing dependencies
COPY . /opt/maubot
RUN cp maubot/example-config.yaml .
COPY ./docker/mbc.sh /usr/local/bin/mbc
COPY --from=frontend-builder /frontend/build /opt/maubot/frontend
ENV UID=1337 GID=1337 XDG_CONFIG_HOME=/data
VOLUME /data
CMD ["/opt/maubot/docker/run.sh"]

View file

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
function fixperms {
chown -R $UID:$GID /var/log /data
@ -43,4 +43,8 @@ if ls /data/plugins/*.db > /dev/null 2>&1; then
mv -n /data/plugins/*.db /data/dbs/
fi
if [ -f "/venv/bin/activate" ] ; then
exec gosu $UID:$GID bash -c 'source /venv/bin/activate && python3 -m maubot -c /data/config.yaml'
fi
exec su-exec $UID:$GID python3 -m maubot -c /data/config.yaml