https://github.com/juwenzhang/micro_fastify
https://github.com/juwenzhang/micro_fastify
cluster consul docker-compose fastify microservice monorepo mysql nodejs pnpm redis typescript
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/juwenzhang/micro_fastify
- Owner: juwenzhang
- Created: 2025-07-20T11:07:39.000Z (8 months ago)
- Default Branch: master
- Last Pushed: 2025-07-20T21:36:53.000Z (8 months ago)
- Last Synced: 2025-07-30T05:23:58.066Z (8 months ago)
- Topics: cluster, consul, docker-compose, fastify, microservice, monorepo, mysql, nodejs, pnpm, redis, typescript
- Language: TypeScript
- Homepage:
- Size: 87.9 KB
- Stars: 3
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### English Document
* docker-compose up -d
* docker-compose build --no-cache
```yaml
version: '3'
services:
mysql:
image: mysql:8.0
environment:
MYSQL_ROOT_PASSWORD: 451674jh
MYSQL_DATABASE: microservice_db
ports:
- "3306:3306"
redis:
image: redis:alpine
ports:
- "6379:6379"
consul:
image: consul:1.15
ports:
- "8500:8500"
```
### Consul 注册服务
* access link: `http://localhost:8500/v1/agent/services`
```text
{
"user-service": {
"ID": "user-service",
"Service": "user-service",
"Tags": [],
"Meta": {},
"Port": 3001,
"Address": "localhost",
"Weights": {
"Passing": 1,
"Warning": 1
},
"EnableTagOverride": false,
"Datacenter": "dc1"
},
"user-service1": {
"ID": "user-service1",
"Service": "user-service1",
"Tags": [],
"Meta": {},
"Port": 3002,
"Address": "localhost",
"Weights": {
"Passing": 1,
"Warning": 1
},
"EnableTagOverride": false,
"Datacenter": "dc1"
}
...more micro service detail info
}
```