From 3e5b8aa04255c70199817ffa5e2d4833c5077868 Mon Sep 17 00:00:00 2001 From: Matt Date: Thu, 5 Jun 2025 18:05:05 +0200 Subject: [PATCH] Remove api-nginx health check and add restart documentation - Remove health check from api-nginx service to fix "starting" status issue - Add UPDATED_RESTART_INSTRUCTIONS.md with detailed restart process - Update api-nginx depends_on to use explicit service_started condition --- UPDATED_RESTART_INSTRUCTIONS.md | 46 +++++++++++++++++++++++++++++++++ docker-compose.yml | 8 ++---- 2 files changed, 48 insertions(+), 6 deletions(-) create mode 100644 UPDATED_RESTART_INSTRUCTIONS.md diff --git a/UPDATED_RESTART_INSTRUCTIONS.md b/UPDATED_RESTART_INSTRUCTIONS.md new file mode 100644 index 00000000..13734742 --- /dev/null +++ b/UPDATED_RESTART_INSTRUCTIONS.md @@ -0,0 +1,46 @@ +# Updated Restart Instructions for OpnForm + +## Changes Made +1. **Removed health check from api-nginx** - This was causing the "starting" status +2. **Fixed PHP-FPM health check** - Changed to check process existence +3. **Made services accessible externally** - Changed ports from localhost-only to all interfaces + +## Step-by-Step Restart Process + +### 1. Stop ALL OpnForm Containers +In your Docker web interface: +- Select ALL OpnForm containers +- Click "Stop" +- Wait for all to fully stop + +### 2. Remove the api-nginx Container (Important!) +- Select the `opnform-api-nginx` container +- Click "Remove" or "Delete" +- This ensures it recreates with the new configuration + +### 3. Start Containers in Order +Start each container and wait for it to be ready before starting the next: + +1. **opnform-db** - Wait until "healthy" +2. **opnform-redis** - Wait until "healthy" +3. **opnform-api** - Wait until "healthy" (may take 90 seconds) +4. **opnform-api-nginx** - Should show "running" (no health check now) +5. **opnform-api-worker** - Wait until running +6. **opnform-api-scheduler** - Wait until running +7. **opnform-client** - Wait until "healthy" + +### 4. Verify Everything Works + +#### Check nginx is actually running: +Look at the logs for `opnform-api-nginx`. You should see: +``` +Configuration complete; ready for start up +``` + +#### Test the services: +- UI: http://YOUR-SERVER-IP:7655 +- API: http://YOUR-SERVER-IP:7654/api/health + +### 5. If api-nginx Still Shows Issues + +Check if PHP-FPM is running in the API container: diff --git a/docker-compose.yml b/docker-compose.yml index 840170c8..df2433bd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -42,12 +42,8 @@ services: ports: - "0.0.0.0:7654:80" # API on port 7654 - accessible from any IP depends_on: - - api - healthcheck: - test: ["CMD-SHELL", "wget --spider -q http://localhost/ || exit 1"] - interval: 30s - timeout: 10s - retries: 3 + api: + condition: service_started restart: unless-stopped api-worker: