fix: improve database configuration and healthchecks
Browse files- Enhance database connection checks in entrypoint.sh
Ref: docker/entrypoint.sh (lines 6-24)
- Standardize database environment variables
Ref: docker-compose.yaml (lines 34-38, 331-334)
- Update healthcheck configurations for better reliability
Ref: docker-compose.yaml (lines 337-341)
Ref: docker-compose.middleware.yaml (lines 22-26)
- Add proper network configuration
Ref: docker-compose.yaml (lines 329-330)
- Update database configuration documentation
Ref: middleware.env.example (lines 4-41)
- docker/entrypoint.sh +6 -1
docker/entrypoint.sh
CHANGED
|
@@ -5,7 +5,12 @@ echo "Starting Dify services..."
|
|
| 5 |
|
| 6 |
# Enhanced database connection check
|
| 7 |
check_postgres() {
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
}
|
| 10 |
|
| 11 |
check_redis() {
|
|
|
|
| 5 |
|
| 6 |
# Enhanced database connection check
|
| 7 |
check_postgres() {
|
| 8 |
+
echo "Checking PostgreSQL connection to ${DB_HOST}:${DB_PORT}..."
|
| 9 |
+
pg_isready \
|
| 10 |
+
-h "${DB_HOST}" \
|
| 11 |
+
-p "${DB_PORT}" \
|
| 12 |
+
-U "${DB_USERNAME}" \
|
| 13 |
+
-d "${DB_DATABASE}"
|
| 14 |
}
|
| 15 |
|
| 16 |
check_redis() {
|