mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-18 20:09:25 +00:00
Added husky pre-commit hook and also added health check on docker_compose service
This commit is contained in:
parent
0a049e23ef
commit
26ec5f6653
4 changed files with 30 additions and 2 deletions
1
.husky/pre-commit
Normal file
1
.husky/pre-commit
Normal file
|
|
@ -0,0 +1 @@
|
|||
pnpm run format
|
||||
|
|
@ -8,6 +8,13 @@ services:
|
|||
- .:/usr/learnhouse
|
||||
environment:
|
||||
- LEARNHOUSE_COOKIE_DOMAIN=.localhost
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
mongo:
|
||||
condition: service_healthy
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
restart: always
|
||||
|
|
@ -17,11 +24,18 @@ services:
|
|||
- POSTGRES_USER=learnhouse
|
||||
- POSTGRES_PASSWORD=learnhouse
|
||||
- POSTGRES_DB=learnhouse
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
redis:
|
||||
image: redis:7.2.3
|
||||
restart: always
|
||||
ports:
|
||||
- "6379:6379"
|
||||
healthcheck:
|
||||
test: [ "CMD", "redis-cli", "--raw", "incr", "ping" ]
|
||||
mongo:
|
||||
image: mongo:5.0
|
||||
restart: always
|
||||
|
|
@ -30,3 +44,5 @@ services:
|
|||
environment:
|
||||
- MONGO_INITDB_ROOT_USERNAME=learnhouse
|
||||
- MONGO_INITDB_ROOT_PASSWORD=learnhouse
|
||||
healthcheck:
|
||||
test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet
|
||||
|
|
@ -4,12 +4,14 @@
|
|||
"build": "turbo run build",
|
||||
"dev": "turbo run dev",
|
||||
"lint": "turbo run lint",
|
||||
"format": "prettier --write \"**/*.{ts,tsx,md}\""
|
||||
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
|
||||
"prepare": "husky"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.51.0",
|
||||
"husky": "^9.0.10",
|
||||
"prettier": "^3.0.3",
|
||||
"turbo": "^1.10.15"
|
||||
},
|
||||
"packageManager": "pnpm@8.6.10"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
9
pnpm-lock.yaml
generated
9
pnpm-lock.yaml
generated
|
|
@ -11,6 +11,9 @@ importers:
|
|||
eslint:
|
||||
specifier: ^8.51.0
|
||||
version: 8.51.0
|
||||
husky:
|
||||
specifier: ^9.0.10
|
||||
version: 9.0.10
|
||||
prettier:
|
||||
specifier: ^3.0.3
|
||||
version: 3.0.3
|
||||
|
|
@ -4395,6 +4398,12 @@ packages:
|
|||
- supports-color
|
||||
dev: false
|
||||
|
||||
/husky@9.0.10:
|
||||
resolution: {integrity: sha512-TQGNknoiy6bURzIO77pPRu+XHi6zI7T93rX+QnJsoYFf3xdjKOur+IlfqzJGMHIK/wXrLg+GsvMs8Op7vI2jVA==}
|
||||
engines: {node: '>=18'}
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/ieee754@1.2.1:
|
||||
resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==}
|
||||
dev: false
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue