add replicas to docker-compose to show scaling ability; update readme

This commit is contained in:
Egor Aristov 2025-02-08 22:02:06 +03:00
parent e9109f9597
commit fcf4bc2231
2 changed files with 9 additions and 1 deletions

View File

@ -53,17 +53,23 @@ Docker-compose deployment uses [deploy/.env file](deploy/.env)
You can see all available options in [config.go file](internal/config/config.go) (struct Config) You can see all available options in [config.go file](internal/config/config.go) (struct Config)
### Scaling
Each worker can process 1 page at a time, so to scale you should run multiple worker instances. This is done using replicas parameter in worker section in [docker-compose.yml file](deploy/docker-compose.yml)
## Development ## Development
You need Go 1.23 (most of application) and Node.js 20 (frontend) You need Go 1.23 (most of application), Node.js 20 (frontend) and Nats server.
Instaling dependencies example for MacOS: Instaling dependencies example for MacOS:
```bash ```bash
brew install go@1.23 brew install go@1.23
brew install node@20 brew install node@20
brew install nats-server # Don't use brew services to manage nats because it lacks config support
go mod download go mod download
cd frontend/wizard-vue && npm install cd frontend/wizard-vue && npm install
nats -js
``` ```
Also this repository contains some useful git hooks. To enable them, use: Also this repository contains some useful git hooks. To enable them, use:

View File

@ -21,6 +21,8 @@ services:
user: pwuser user: pwuser
security_opt: security_opt:
- seccomp:seccomp_profile.json - seccomp:seccomp_profile.json
deploy:
replicas: 1
restart: unless-stopped restart: unless-stopped
nats: nats: