updates again

This commit is contained in:
Jake Kasper
2025-08-21 07:43:43 -05:00
parent 041c603d76
commit cebfbd9454
6 changed files with 40 additions and 6 deletions

View File

@@ -23,9 +23,9 @@ USER turftracker
# Expose port
EXPOSE 3000
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:3000 || exit 1
# Health check using Node.js script
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
CMD node healthcheck.js
# Start the application
CMD ["npm", "start"]

33
frontend/healthcheck.js Normal file
View File

@@ -0,0 +1,33 @@
const http = require('http');
const options = {
hostname: 'localhost',
port: 3000,
path: '/',
method: 'GET',
timeout: 3000
};
const req = http.request(options, (res) => {
// Accept any 2xx or 3xx status code (React dev server might redirect)
if (res.statusCode >= 200 && res.statusCode < 400) {
console.log('Health check passed');
process.exit(0);
} else {
console.log(`Health check failed with status: ${res.statusCode}`);
process.exit(1);
}
});
req.on('error', (err) => {
console.log('Health check error:', err.message);
process.exit(1);
});
req.on('timeout', () => {
console.log('Health check timeout');
req.destroy();
process.exit(1);
});
req.end();

View File

@@ -23,7 +23,6 @@ import {
CalendarDaysIcon as CalendarIconSolid,
ClockIcon as ClockIconSolid,
CloudIcon as CloudIconSolid,
UserIcon as UserIconSolid,
} from '@heroicons/react/24/solid';
import { useAuth } from '../../hooks/useAuth';

View File

@@ -8,7 +8,6 @@ import {
ClockIcon,
CloudIcon,
PlusIcon,
ArrowTrendingUpIcon,
} from '@heroicons/react/24/outline';
import { useAuth } from '../../hooks/useAuth';