feature: make dev — api и worker на хосте с видимым окном Chrome (#90)
- docker-compose.dev.yml: порты rabbitmq, redis, postgres на 127.0.0.1 (5673, 6380, 5433 — стандартные часто заняты другими проектами) - make dev: останавливает контейнерные api и worker (иначе worker в Docker тоже берёт задачи из общей очереди и выполняет их невидимо), поднимает инфраструктуру, запускает uvicorn --reload на :8010 и воркер dramatiq; Ctrl+C останавливает оба - make dev-key name=...: API-ключ без контейнера api - README: раздел Local development Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
999644883f
commit
fdee12e2d8
3 files changed
+60
-8
No files matched your search
@@ -167,14 +167,17 @@ Not done yet:
|
||||
## Local development
|
||||
|
||||
```bash
|
||||
make sync-offline # venv in ~/.py_envs/robotex; another path: make VENV=... <target>
|
||||
docker compose up -d rabbitmq redis # queue and storage
|
||||
cd src && RABBITMQ_URL=... REDIS_URL=... uvicorn main:app --reload
|
||||
cd src && dramatiq worker.actors --processes 1 --threads 4
|
||||
make sync-offline # venv in ~/.py_envs/robotex; another path: make VENV=... <target>
|
||||
make dev # api + worker on the host, Chrome windows visible on your desktop; API on :8010
|
||||
make dev-key name=local # API key for it (stored in the same postgres volume as make up)
|
||||
```
|
||||
|
||||
The compose network is not published, so for running the services on the host publish `5672` and `6379` yourself,
|
||||
or just use `make up`. Chrome runs headful, so a display is required (locally — your desktop, in Docker — Xvfb).
|
||||
`make dev` stops the containerized api and worker (otherwise the Docker worker also takes tasks from the common
|
||||
queue and runs them invisibly), starts rabbitmq, redis and postgres with ports published on 127.0.0.1
|
||||
(`docker-compose.dev.yml`: 5673, 6380, 5433), then runs uvicorn with `--reload` and the dramatiq worker in the
|
||||
foreground. Ctrl+C stops both; `make down` stops the infrastructure. Ports, slots: `DEV_API_PORT`,
|
||||
`DEV_RABBITMQ_PORT`, `DEV_REDIS_PORT`, `DEV_POSTGRES_PORT`, `DEV_SLOTS` (default 2). Chrome runs headful, so a display
|
||||
is required (locally — your desktop, in Docker — Xvfb).
|
||||
|
||||
Tests:
|
||||
|
||||
|
||||
Reference in new issue
Block a user