mirror of
https://gitflic.ru/project/alt-gnome/karkas.git
synced 2024-12-23 16:23:02 +03:00
добавлен src/altlinux
This commit is contained in:
parent
e2f5e8daba
commit
067fa52719
@ -15,6 +15,10 @@
|
||||
{
|
||||
"name": "Gnomik",
|
||||
"path": "src/gnomik"
|
||||
},
|
||||
{
|
||||
"name": "ALT Linux",
|
||||
"path": "src/altlinux"
|
||||
}
|
||||
],
|
||||
"extensions": {
|
||||
|
23
src/altlinux/Dockerfile
Normal file
23
src/altlinux/Dockerfile
Normal file
@ -0,0 +1,23 @@
|
||||
FROM python:3.12-slim as builder
|
||||
|
||||
RUN pip install poetry
|
||||
RUN mkdir -p /app
|
||||
COPY . /app
|
||||
|
||||
# Фикс
|
||||
|
||||
RUN sed -i '/ocab-core = {/{s/, develop = true//}' /app/src/altlinux/pyproject.toml && \
|
||||
sed -i '/ocab-modules = {/{s/, develop = true//}' /app/src/altlinux/pyproject.toml && \
|
||||
sed -i '/ocab-core = {/{s/, develop = true//}' /app/src/ocab_modules/pyproject.toml
|
||||
|
||||
WORKDIR /app/src/altlinux
|
||||
|
||||
RUN poetry lock && poetry install
|
||||
|
||||
FROM python:3.12-slim as base
|
||||
|
||||
COPY --from=builder /app/src/altlinux /app
|
||||
|
||||
WORKDIR /app
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
CMD ["python", "-m", "altlinux"]
|
14
src/altlinux/Dockerfile.dockerignore
Normal file
14
src/altlinux/Dockerfile.dockerignore
Normal file
@ -0,0 +1,14 @@
|
||||
**/Dockerfile
|
||||
**/*.dockerignore
|
||||
**/docker-compose.yml
|
||||
|
||||
**/.git
|
||||
**/.gitignore
|
||||
|
||||
**/.venv
|
||||
|
||||
**/.mypy_cache
|
||||
**/__pycache__/
|
||||
|
||||
src/gnomik/config.yaml
|
||||
src/gnomik/database/*
|
47
src/altlinux/README.md
Normal file
47
src/altlinux/README.md
Normal file
@ -0,0 +1,47 @@
|
||||
# ALT Linux
|
||||
|
||||
## Описание
|
||||
|
||||
<!--
|
||||
TODO: добавить описание
|
||||
-->
|
||||
|
||||
## Функционал
|
||||
|
||||
<!--
|
||||
TODO: описать функционал
|
||||
-->
|
||||
|
||||
## Запуск
|
||||
|
||||
### Docker
|
||||
|
||||
1. Соберите Docker-образ:
|
||||
```bash
|
||||
docker build -t gnomik .
|
||||
```
|
||||
2. Запустите контейнер:
|
||||
```bash
|
||||
docker run -p 9000:9000 -v ./config.yaml:/app/config.yaml -v ./database:/app/database gnomik
|
||||
```
|
||||
|
||||
Замените `./config.yaml` и `./database` на пути к вашим локальным файлам конфигурации и паки для базы данных.
|
||||
|
||||
### Вручную
|
||||
|
||||
1. Активируйте виртуальное окружение Gnomика:
|
||||
```bash
|
||||
poetry shell
|
||||
```
|
||||
2. Запустите бота:
|
||||
```bash
|
||||
python -m gnomik
|
||||
```
|
||||
|
||||
## Конфигурация
|
||||
|
||||
Конфигурация бота находится в файле `config.yaml`.
|
||||
|
||||
## Модули
|
||||
|
||||
Список загружаемых модулей указан в файле `__main__.py`.
|
0
src/altlinux/altlinux/__init__.py
Normal file
0
src/altlinux/altlinux/__init__.py
Normal file
19
src/altlinux/altlinux/__main__.py
Normal file
19
src/altlinux/altlinux/__main__.py
Normal file
@ -0,0 +1,19 @@
|
||||
import asyncio
|
||||
|
||||
from ocab_core import OCAB
|
||||
from ocab_modules import module_loader
|
||||
|
||||
|
||||
async def main():
|
||||
ocab = OCAB()
|
||||
await ocab.init_app(
|
||||
[
|
||||
module_loader("standard", "config", safe=False),
|
||||
module_loader("standard", "command_helper"),
|
||||
# module_loader("standard", "report"),
|
||||
]
|
||||
)
|
||||
await ocab.start()
|
||||
|
||||
|
||||
asyncio.run(main())
|
7
src/altlinux/config-example.yaml
Normal file
7
src/altlinux/config-example.yaml
Normal file
@ -0,0 +1,7 @@
|
||||
core:
|
||||
mode: LONG_POLLING
|
||||
token: xxx
|
||||
|
||||
report:
|
||||
allowed_groups:
|
||||
- -1111111
|
9
src/altlinux/docker-compose.yml
Normal file
9
src/altlinux/docker-compose.yml
Normal file
@ -0,0 +1,9 @@
|
||||
version: '3'
|
||||
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: src/altlinux/Dockerfile
|
||||
volumes:
|
||||
- ./config.yaml:/app/config.yaml
|
2162
src/altlinux/poetry.lock
generated
Normal file
2162
src/altlinux/poetry.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
2
src/altlinux/poetry.toml
Normal file
2
src/altlinux/poetry.toml
Normal file
@ -0,0 +1,2 @@
|
||||
[virtualenvs]
|
||||
in-project = true
|
17
src/altlinux/pyproject.toml
Normal file
17
src/altlinux/pyproject.toml
Normal file
@ -0,0 +1,17 @@
|
||||
[tool.poetry]
|
||||
name = "altlinux"
|
||||
version = "0.1.0"
|
||||
description = ""
|
||||
authors = [
|
||||
"Максим Слипенко <maxim@slipenko.com>"
|
||||
]
|
||||
readme = "README.md"
|
||||
|
||||
[tool.poetry.dependencies]
|
||||
python = "~3.12"
|
||||
ocab-core = { extras=["webhook"], path = "../ocab_core", develop = true }
|
||||
ocab-modules = { path = "../ocab_modules", develop = true }
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry-core"]
|
||||
build-backend = "poetry.core.masonry.api"
|
Loading…
Reference in New Issue
Block a user