moved dockerfile to main repo (#4393)

This commit is contained in:
Toby Batch
2023-11-17 12:07:51 +00:00
committed by GitHub
parent 6a828cc9bd
commit 350875be2a
9 changed files with 705 additions and 0 deletions

59
.docker/self-test.sh Executable file
View File

@@ -0,0 +1,59 @@
#!/bin/sh
/startup.sh 2>&1
echo $$ > /tmp/startup.pid
echo "Waiting for kimai to install"
while [ ! -f /opt/kimai/var/installed ]; do
echo -n ". "
sleep 5
done
echo
# Test FPM CGI
if [ -f /use_fpm ]; then
export SCRIPT_NAME=/opt/kimai/public/index.php
export SCRIPT_FILENAME=/opt/kimai/public/index.php
export REQUEST_METHOD=GET
export SERVER_ADDR=localhost
COUNT=0
until cgi-fcgi -bind -connect 127.0.0.1:9000 &> /dev/null
do
COUNT=$((COUNT+1))
echo "Waiting for FPM Server to start (${COUNT})"
sleep 3
if [ "$COUNT" -gt 5 ]; then
echo "FPM Failed to start."
exit 1
fi
done
fi
# Test Apache/httpd
if [ -f /use_apache ]; then
COUNT=0
until curl -s -o /dev/null http://localhost:8001
do
COUNT=$((COUNT+1))
echo "Waiting for Apache/HTTP to start (${COUNT})" &> /dev/null
sleep 3
if [ "$COUNT" -gt 5 ]; then
echo "Apache/HTTP failed to start."
exit 1
fi
done
fi
# Test PHP/Kimai
/opt/kimai/bin/console kimai:version
if [ $? != 0 ]; then
echo "PHP/Kimai not responding"
exit 1
fi
kill $(cat /tmp/startup.pid)