FossilRepo
Fix Docker health check: accept redirects, increase start period, Caddy starts without waiting
Commit
078489d21aaa087c1c25aff879ebed3b7333671cbbd257afb962f9195d6368d0
Parent
4e1dde0f6daf98a…
1 file changed
+5
-5
+5
-5
| --- install.sh | ||
| +++ install.sh | ||
| @@ -1200,15 +1200,15 @@ | ||
| 1200 | 1200 | condition: service_healthy |
| 1201 | 1201 | redis: |
| 1202 | 1202 | condition: service_healthy |
| 1203 | 1203 | restart: unless-stopped |
| 1204 | 1204 | healthcheck: |
| 1205 | - test: [\"CMD-SHELL\", \"curl -f http://localhost:8000/health/ || exit 1\"] | |
| 1206 | - interval: 30s | |
| 1205 | + test: [\"CMD-SHELL\", \"curl -sf -o /dev/null -w '%{http_code}' http://localhost:8000/health/ | grep -qE '200|301|302' || exit 1\"] | |
| 1206 | + interval: 15s | |
| 1207 | 1207 | timeout: 10s |
| 1208 | - retries: 3 | |
| 1209 | - start_period: 40s | |
| 1208 | + retries: 5 | |
| 1209 | + start_period: 60s | |
| 1210 | 1210 | |
| 1211 | 1211 | celery-worker: |
| 1212 | 1212 | build: |
| 1213 | 1213 | context: ./src |
| 1214 | 1214 | dockerfile: Dockerfile |
| @@ -1282,11 +1282,11 @@ | ||
| 1282 | 1282 | - caddy-data:/data |
| 1283 | 1283 | - caddy-config:/config |
| 1284 | 1284 | - static-files:/srv/static:ro |
| 1285 | 1285 | depends_on: |
| 1286 | 1286 | app: |
| 1287 | - condition: service_healthy | |
| 1287 | + condition: service_started | |
| 1288 | 1288 | restart: unless-stopped |
| 1289 | 1289 | ${litestream_service} |
| 1290 | 1290 | volumes: |
| 1291 | 1291 | pgdata: |
| 1292 | 1292 | redisdata: |
| 1293 | 1293 |
| --- install.sh | |
| +++ install.sh | |
| @@ -1200,15 +1200,15 @@ | |
| 1200 | condition: service_healthy |
| 1201 | redis: |
| 1202 | condition: service_healthy |
| 1203 | restart: unless-stopped |
| 1204 | healthcheck: |
| 1205 | test: [\"CMD-SHELL\", \"curl -f http://localhost:8000/health/ || exit 1\"] |
| 1206 | interval: 30s |
| 1207 | timeout: 10s |
| 1208 | retries: 3 |
| 1209 | start_period: 40s |
| 1210 | |
| 1211 | celery-worker: |
| 1212 | build: |
| 1213 | context: ./src |
| 1214 | dockerfile: Dockerfile |
| @@ -1282,11 +1282,11 @@ | |
| 1282 | - caddy-data:/data |
| 1283 | - caddy-config:/config |
| 1284 | - static-files:/srv/static:ro |
| 1285 | depends_on: |
| 1286 | app: |
| 1287 | condition: service_healthy |
| 1288 | restart: unless-stopped |
| 1289 | ${litestream_service} |
| 1290 | volumes: |
| 1291 | pgdata: |
| 1292 | redisdata: |
| 1293 |
| --- install.sh | |
| +++ install.sh | |
| @@ -1200,15 +1200,15 @@ | |
| 1200 | condition: service_healthy |
| 1201 | redis: |
| 1202 | condition: service_healthy |
| 1203 | restart: unless-stopped |
| 1204 | healthcheck: |
| 1205 | test: [\"CMD-SHELL\", \"curl -sf -o /dev/null -w '%{http_code}' http://localhost:8000/health/ | grep -qE '200|301|302' || exit 1\"] |
| 1206 | interval: 15s |
| 1207 | timeout: 10s |
| 1208 | retries: 5 |
| 1209 | start_period: 60s |
| 1210 | |
| 1211 | celery-worker: |
| 1212 | build: |
| 1213 | context: ./src |
| 1214 | dockerfile: Dockerfile |
| @@ -1282,11 +1282,11 @@ | |
| 1282 | - caddy-data:/data |
| 1283 | - caddy-config:/config |
| 1284 | - static-files:/srv/static:ro |
| 1285 | depends_on: |
| 1286 | app: |
| 1287 | condition: service_started |
| 1288 | restart: unless-stopped |
| 1289 | ${litestream_service} |
| 1290 | volumes: |
| 1291 | pgdata: |
| 1292 | redisdata: |
| 1293 |