diff --git a/.env.example b/.env.example index ef8e7ce..c7edcbc 100644 --- a/.env.example +++ b/.env.example @@ -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 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0dbb156 --- /dev/null +++ b/Dockerfile @@ -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"] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..480ecad --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,5 @@ +services: + matrix-bot: + build: . + env_file: .env + restart: unless-stopped