feat(04-03): add matrix bot containerization
- add Dockerfile for matrix bot runtime - add compose service and env template entries
This commit is contained in:
parent
2720ee2d6e
commit
4628304979
3 changed files with 35 additions and 0 deletions
|
|
@ -9,6 +9,9 @@ MATRIX_PASSWORD=your_password_here
|
|||
# Lambda Platform
|
||||
LAMBDA_PLATFORM_URL=http://localhost:8000
|
||||
LAMBDA_SERVICE_TOKEN=your_service_token_here
|
||||
AGENT_WS_URL=ws://127.0.0.1:8000/agent_ws/
|
||||
AGENT_BASE_URL=http://127.0.0.1:8000
|
||||
MATRIX_PLATFORM_BACKEND=real
|
||||
|
||||
# Режим работы: "mock" или "production"
|
||||
PLATFORM_MODE=mock
|
||||
|
|
|
|||
27
Dockerfile
Normal file
27
Dockerfile
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PYTHONPATH=/app
|
||||
ENV UV_PROJECT_ENVIRONMENT=/usr/local
|
||||
|
||||
# Install uv for dependency management inside the container.
|
||||
RUN pip install --no-cache-dir uv
|
||||
|
||||
# Copy dependency manifests first for layer caching.
|
||||
COPY pyproject.toml uv.lock* ./
|
||||
|
||||
# Install project dependencies into the system environment.
|
||||
RUN uv sync --no-dev --no-install-project --frozen 2>/dev/null || uv sync --no-dev --no-install-project
|
||||
|
||||
# Copy project source after dependency layers.
|
||||
COPY . .
|
||||
|
||||
# Install the project itself and keep runtime dependencies in sync.
|
||||
RUN uv sync --no-dev --frozen 2>/dev/null || uv sync --no-dev
|
||||
|
||||
# Install lambda_agent_api from the local source tree, bypassing its Python version guard.
|
||||
RUN pip install --no-cache-dir --ignore-requires-python /app/external/platform-agent_api
|
||||
|
||||
CMD ["python", "-m", "adapter.matrix.bot"]
|
||||
5
docker-compose.yml
Normal file
5
docker-compose.yml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
services:
|
||||
matrix-bot:
|
||||
build: .
|
||||
env_file: .env
|
||||
restart: unless-stopped
|
||||
Loading…
Add table
Add a link
Reference in a new issue