mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
docker add cleanup service
This commit is contained in:
@@ -91,6 +91,18 @@ elif [ "$SERVICE_NAME" = "scheduler" ]; then
|
|||||||
sleep 5;
|
sleep 5;
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
elif [ "$SERVICE_NAME" = "cleanup" ]; then
|
||||||
|
echo_info "Start Cleanup ...";
|
||||||
|
while true; do
|
||||||
|
if [ -f "$ENV_FILE" ] && [ -d "$VENDOR_DIR" ]; then
|
||||||
|
echo_success "[Cleanup] Run cleanup:run at $(date '+%Y-%m-%d %H:%M:%S')";
|
||||||
|
php include/cleanup_cli.php;
|
||||||
|
sleep 60;
|
||||||
|
else
|
||||||
|
echo_info "[Cleanup] .env or vendor not exists,wait 5 seconds...";
|
||||||
|
sleep 5;
|
||||||
|
fi
|
||||||
|
done
|
||||||
else
|
else
|
||||||
echo_error "Unknown SERVICE_NAME: $SERVICE_NAME, exiting."
|
echo_error "Unknown SERVICE_NAME: $SERVICE_NAME, exiting."
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
@@ -56,6 +56,25 @@ services:
|
|||||||
max-file: "3"
|
max-file: "3"
|
||||||
networks:
|
networks:
|
||||||
- appnet
|
- appnet
|
||||||
|
-
|
||||||
|
cleanup:
|
||||||
|
image: nexusphp_php
|
||||||
|
container_name: nexusphp-cleanup
|
||||||
|
environment:
|
||||||
|
SERVICE_NAME: cleanup
|
||||||
|
volumes:
|
||||||
|
- .:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- php
|
||||||
|
- redis
|
||||||
|
- mysql
|
||||||
|
logging:
|
||||||
|
driver: "json-file"
|
||||||
|
options:
|
||||||
|
max-size: "1024m"
|
||||||
|
max-file: "3"
|
||||||
|
networks:
|
||||||
|
- appnet
|
||||||
|
|
||||||
openresty:
|
openresty:
|
||||||
build:
|
build:
|
||||||
|
|||||||
Reference in New Issue
Block a user