Update Docker configuration and documentation for Linux compatibility. Added extra_hosts for Docker Compose and updated GATEWAY_RUN.md to reflect changes in running commands for Linux. Enhanced GitHub Actions workflow for building and pushing Docker images.
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
# telemt-api
|
||||
|
||||
HTTP‑шлюз на Go для [Telemt Control API](docs/API.md): один порт, **белый список IP (CIDR)**, маршруты вида `/api/{alias}/…` → `{base_url}/v1/…`, метрики Prometheus на `/metrics`.
|
||||
|
||||
## Быстрый старт (Linux)
|
||||
|
||||
Предполагается установлены Docker и Docker Compose v2.
|
||||
|
||||
```bash
|
||||
git clone <url-репозитория> && cd telemt-api
|
||||
cp config.example.yaml config.yaml
|
||||
# отредактируйте config.yaml: servers, whitelist_cidrs или allow_all для разработки
|
||||
docker build -t telemt-api-gateway:local .
|
||||
docker run -d --name telemt-gateway \
|
||||
-p 8080:8080 \
|
||||
-v "$(pwd)/config.yaml:/etc/telemt-gateway/config.yaml:ro" \
|
||||
-e CONFIG_PATH=/etc/telemt-gateway/config.yaml \
|
||||
telemt-api-gateway:local
|
||||
curl -sS http://127.0.0.1:8080/health
|
||||
curl -sS http://127.0.0.1:8080/api/main_srv/health
|
||||
```
|
||||
|
||||
Или через Compose (пример конфига смотрите в `config.compose.yaml`):
|
||||
|
||||
```bash
|
||||
docker compose up -d --build
|
||||
docker compose logs -f gateway
|
||||
```
|
||||
|
||||
## Документация
|
||||
|
||||
| Документ | Содержание |
|
||||
|----------|------------|
|
||||
| **[docs/GATEWAY_RUN.md](docs/GATEWAY_RUN.md)** | Полная инструкция: конфиг, Docker CLI, Compose, CI/CD, неполадки |
|
||||
| **[docs/API.md](docs/API.md)** | Контракт Telemt Control API (`/v1/…`) |
|
||||
|
||||
## Сборка и тесты без Docker
|
||||
|
||||
```bash
|
||||
go mod tidy && go test ./...
|
||||
```
|
||||
|
||||
## CI/CD
|
||||
|
||||
В репозитории: [.gitea/workflows/docker.yaml](.gitea/workflows/docker.yaml) — тесты Go, сборка и публикация образа в Container Registry Gitea (см. раздел «Обновление и CI/CD» в [docs/GATEWAY_RUN.md](docs/GATEWAY_RUN.md)).
|
||||
Reference in New Issue
Block a user