feat: add healthcheck configuration to Docker Compose files
- Introduced healthcheck settings for services in both docker-compose.yml and docker-compose-all-immich.yml. - Configured healthcheck to verify service availability by checking the health endpoint at http://localhost:3000/api/health.
This commit is contained in:
1 parent
39e4db0f8d
commit
997246d937
3 files changed
+21
No files matched your search
@@ -57,6 +57,12 @@ services:
|
|||||||
- "8001:3000"
|
- "8001:3000"
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 40s
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
model-cache:
|
model-cache:
|
||||||
|
|||||||
@@ -8,3 +8,9 @@ services:
|
|||||||
- "3000:3000"
|
- "3000:3000"
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:3000/api/health"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 10s
|
||||||
|
retries: 3
|
||||||
|
start_period: 40s
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
import { NextApiRequest, NextApiResponse } from 'next';
|
||||||
|
|
||||||
|
export default function handler(req: NextApiRequest, res: NextApiResponse) {
|
||||||
|
if (req.method !== 'GET') {
|
||||||
|
return res.status(405).json({ message: 'Method not allowed' });
|
||||||
|
}
|
||||||
|
|
||||||
|
return res.status(200).json({ status: 'healthy' });
|
||||||
|
}
|
||||||
Reference in new issue
Block a user