first jenkins run

This commit is contained in:
2025-07-26 17:40:55 -07:00
parent a29ec39252
commit 7496df0174
8 changed files with 29 additions and 68 deletions

View File

@ -1,11 +0,0 @@
services:
photo_refresh:
container_name: photo_refresh
image: php:8.0-apache
ports:
- 8080:80
volumes:
- /opt/docker/photo_refresh/:/var/www/html/
network_mode: bridge
restart: always

View File

@ -1,17 +0,0 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Dynamic Image Update</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
</head>
<body>
<img id="refreshedImage" src="getImage.php" width="400" alt="Refreshed Image">
<script>
// Function to update the image every other second using AJAX
setInterval(function() {
$('#refreshedImage').attr('src', 'getImage.php?_=' + new Date().getTime()); // Adding timestamp to avoid caching
}, 2000);
</script>
</body>
</html>

View File

@ -1,22 +0,0 @@
<?php
header("Cache-Control: no-cache, must-revalidate");
// Path to the directory where the images are stored
$imageDirectory = 'capture/';
// Get the list of image files in the directory
$imageFiles = glob($imageDirectory . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);
// If there are no image files, return a default image
if (empty($imageFiles)) {
$defaultImage = 'default.jpg'; // Provide path to your default image
header('Content-Type: image/jpeg'); // Adjust content type if default image type is different
readfile($defaultImage);
exit;
}
// Sort the image files by modification time, latest first
array_multisort(array_map('filemtime', $imageFiles), SORT_DESC, $imageFiles);
// Get the path to the latest image file
$latestImage = $imageFiles[0];
// Set header type
header('Content-Type: image/jpeg');
// Get the image
readfile($latestImage);
?>