chore: add tools container + base/dev compose

This commit is contained in:
yiekheng 2026-05-09 15:10:06 +08:00
parent a553b538a5
commit c49c0a75dc
3 changed files with 49 additions and 0 deletions

32
docker-compose.base.yml Normal file
View File

@ -0,0 +1,32 @@
services:
tools:
build:
context: .
dockerfile: docker/tools.Dockerfile
image: cm-whatsapp-tools:dev
container_name: cmbot-tools
user: "${HOST_UID:-1000}:${HOST_GID:-1000}"
working_dir: /workspace
command: ["tail", "-f", "/dev/null"]
volumes:
- .:/workspace
environment:
HOME: /tmp
PNPM_HOME: /workspace/.pnpm-store
DATABASE_URL: ${DATABASE_URL}
TELEGRAM_BOT_TOKEN: ${TELEGRAM_BOT_TOKEN:-unset}
TELEGRAM_OPERATOR_WHITELIST: ${TELEGRAM_OPERATOR_WHITELIST:-0}
TELEGRAM_QR_CHAT_ID: ${TELEGRAM_QR_CHAT_ID:-0}
DATA_DIR: ${DATA_DIR:-/data}
SESSIONS_DIR: ${SESSIONS_DIR:-/data/sessions}
MEDIA_DIR: ${MEDIA_DIR:-/data/media}
BOT_HEALTH_PORT: ${BOT_HEALTH_PORT:-8081}
BOT_LOG_LEVEL: ${BOT_LOG_LEVEL:-info}
SEED_OPERATOR_TELEGRAM_ID: ${SEED_OPERATOR_TELEGRAM_ID:-0}
SEED_OPERATOR_NAME: ${SEED_OPERATOR_NAME:-Operator}
networks:
- cmbot
networks:
cmbot:
driver: bridge

6
docker-compose.dev.yml Normal file
View File

@ -0,0 +1,6 @@
services:
tools:
image: cm-whatsapp-tools:dev
build:
context: .
dockerfile: docker/tools.Dockerfile

11
docker/tools.Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM node:22-alpine
# Lightweight build deps for any future native modules (qrcode is pure JS;
# baileys uses precompiled libsignal). git is needed by some pnpm workflows.
RUN apk add --no-cache git python3 make g++ \
&& corepack enable \
&& corepack prepare pnpm@9.12.0 --activate
WORKDIR /workspace
ENV PNPM_HOME=/workspace/.pnpm-store
CMD ["tail", "-f", "/dev/null"]