Use another method to check PHP FPM health
authorWilliam Desportes <redacted>
Wed, 18 Aug 2021 16:33:46 +0000 (18:33 +0200)
committerWilliam Desportes <redacted>
Wed, 15 Sep 2021 21:21:21 +0000 (23:21 +0200)
tests/docker-compose.test-fpm-postgres.yml

index 94b52ca246f906b8c586fce799301a0a279b8c42..638853b76d5b8d4db7f38ea8b6183fc4b1d6b29a 100644 (file)
@@ -5,7 +5,9 @@ services:
     image: ${ROUNDCUBEMAIL_TEST_IMAGE:-roundcube-test-fpm}
     healthcheck:
       # Check until the FPM port is in in the LISTEN list
-      test: ["CMD-SHELL", "netstat -an | grep -q -F \":9000\""]
+      # test: ["CMD-SHELL", "netstat -an | grep -q -F \":9000\""]
+      # Or use php to test php since the non alpine fpm image has no binary able to know if a port is in listen mode
+      test: ["CMD-SHELL", "php -r '$$c = @fsockopen(\"localhost\", 9000); if (is_resource($$c)) { fwrite(STDOUT, \"OK\"); fclose($$c); exit(0); } else { fwrite(STDERR, \"FAIL\"); exit(1); }'"]
       interval: 2s
       timeout: 3s
       retries: 30
git clone https://git.99rst.org/PROJECT