Fix production versions in packages

This commit is contained in:
TheMaddax 2024-11-23 21:01:47 -06:00
parent bb1215e459
commit 8e6bcb66a9
6 changed files with 61 additions and 29 deletions

View file

@ -1,20 +1,37 @@
# Build stage # Build stage
FROM node:18-alpine as build FROM --platform=linux/amd64 node:18-alpine as build
ARG NODE_ENV=production ARG NODE_ENV=production
ENV NODE_ENV=${NODE_ENV} ENV NODE_ENV=${NODE_ENV}
WORKDIR /app WORKDIR /app
# System dependencies with enhanced build tools
RUN apk add --no-cache python3 make g++ curl git libc6-compat
# Clean and prepare npm
RUN npm cache clean --force
RUN npm install -g npm@latest
# Install dependencies with matching versions
COPY package*.json ./ COPY package*.json ./
RUN npm ci RUN npm ci --no-optional --platform=linux --arch=x64 --libc=musl
RUN npm install -g typescript RUN npm install -g typescript
RUN npm install --save-dev @types/react-dom @types/vite @vitejs/plugin-react RUN npm install --save-dev @types/react-dom
RUN npm install @rollup/rollup-linux-x64-musl
RUN npm install esbuild@0.21.5
# Copy source code and build
COPY . . COPY . .
RUN npm run build RUN npm run build
# Production stage # Production stage with Nginx
FROM nginx:alpine FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html COPY --from=build /app/dist /usr/share/nginx/html
COPY nginx.conf /etc/nginx/conf.d/default.conf COPY nginx.conf /etc/nginx/conf.d/default.conf
# Health check for container monitoring
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost/ || exit 1 CMD curl -f http://localhost/ || exit 1
# Expose port and start Nginx
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"] CMD ["nginx", "-g", "daemon off;"]

View file

@ -5,7 +5,7 @@
"type": "module", "type": "module",
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc -b && vite build", "build": "ROLLUP_SKIP_NODE_RESOLVE=true tsc -b && vite build",
"lint": "eslint .", "lint": "eslint .",
"preview": "vite preview" "preview": "vite preview"
}, },

View file

@ -4,7 +4,7 @@ import { FaGraduationCap, FaAward, FaHandsHelping } from 'react-icons/fa'
import SnowPeaks from '../components/SnowPeaks' import SnowPeaks from '../components/SnowPeaks'
const About = () => { const About = () => {
const [ref, inView] = useInView({ const { ref, inView } = useInView({
triggerOnce: true, triggerOnce: true,
threshold: 0.1, threshold: 0.1,
}) })
@ -105,10 +105,13 @@ const About = () => {
{/* Vision Section */} {/* Vision Section */}
<section className="py-20 bg-secondary text-accent-snow"> <section className="py-20 bg-secondary text-accent-snow">
<div className="max-w-7xl mx-auto px-4 text-center"> <div
ref={ref}
className="max-w-7xl mx-auto px-4 text-center"
>
<motion.div <motion.div
initial={{ opacity: 0, y: 30 }} initial={{ opacity: 0, y: 30 }}
whileInView={{ opacity: 1, y: 0 }} animate={inView ? { opacity: 1, y: 0 } : {}}
transition={{ duration: 0.8 }} transition={{ duration: 0.8 }}
> >
<h2 className="text-3xl font-bold mb-6">Our Vision</h2> <h2 className="text-3xl font-bold mb-6">Our Vision</h2>

View file

@ -1,6 +1,6 @@
import { useState } from 'react' import { useState } from 'react'
import { motion } from 'framer-motion' import { motion } from 'framer-motion'
import { FaEnvelope, FaMapMarkerAlt, FaClock } from 'react-icons/fa' import { FaEnvelope, FaMapMarkerAlt } from 'react-icons/fa'
const Contact = () => { const Contact = () => {
const [formData, setFormData] = useState({ const [formData, setFormData] = useState({

View file

@ -1,18 +1,12 @@
import { motion } from 'framer-motion' import { motion } from 'framer-motion'
import { useInView } from 'react-intersection-observer' import { useInView } from 'react-intersection-observer'
import { useNavigate } from 'react-router-dom'
const Home = () => { const Home = () => {
const navigate = useNavigate()
const [ref, inView] = useInView({ const [ref, inView] = useInView({
triggerOnce: true, triggerOnce: true,
threshold: 0.1, threshold: 0.1,
}) })
const handleLearnMore = () => {
navigate('/services')
}
return ( return (
<div> <div>
{/* Hero Section */} {/* Hero Section */}
@ -41,7 +35,9 @@ const Home = () => {
</p> </p>
</motion.div> </motion.div>
</div> </div>
</section> {/* Mission Statement Section */} </section>
{/* Mission Statement Section */}
<motion.section <motion.section
ref={ref} ref={ref}
initial={{ opacity: 0, y: 50 }} initial={{ opacity: 0, y: 50 }}

View file

@ -5,9 +5,25 @@ import { FaFileAlt, FaGlobe, FaUsers, FaChalkboardTeacher, FaTimes, FaMapMarkerA
const geoUrl = "https://cdn.jsdelivr.net/npm/us-atlas@3/states-10m.json" const geoUrl = "https://cdn.jsdelivr.net/npm/us-atlas@3/states-10m.json"
const relationshipPoints = [ type Coordinates = [number, number]
interface Event {
name: string
description: string
startDate: string
endDate: string
}
interface RelationshipPoint {
coordinates: Coordinates
city: string
state: string
events: Event[]
}
const relationshipPoints: RelationshipPoint[] = [
{ {
coordinates: [-106.6504, 35.0844], coordinates: [-106.6504, 35.0844] as Coordinates,
city: "Albuquerque", city: "Albuquerque",
state: "New Mexico", state: "New Mexico",
events: [{ events: [{
@ -18,7 +34,7 @@ const relationshipPoints = [
}] }]
}, },
{ {
coordinates: [-80.8431, 35.2271], coordinates: [-80.8431, 35.2271] as Coordinates,
city: "Charlotte", city: "Charlotte",
state: "North Carolina", state: "North Carolina",
events: [{ events: [{
@ -29,7 +45,7 @@ const relationshipPoints = [
}] }]
}, },
{ {
coordinates: [-104.9903, 39.7392], coordinates: [-104.9903, 39.7392] as Coordinates,
city: "Denver", city: "Denver",
state: "Colorado", state: "Colorado",
events: [ events: [
@ -48,7 +64,7 @@ const relationshipPoints = [
] ]
}, },
{ {
coordinates: [-84.3879, 33.7490], coordinates: [-84.3879, 33.7490] as Coordinates,
city: "Atlanta", city: "Atlanta",
state: "Georgia", state: "Georgia",
events: [{ events: [{
@ -59,7 +75,7 @@ const relationshipPoints = [
}] }]
}, },
{ {
coordinates: [-93.2650, 44.9778], coordinates: [-93.2650, 44.9778] as Coordinates,
city: "Minneapolis", city: "Minneapolis",
state: "Minnesota", state: "Minnesota",
events: [{ events: [{
@ -70,7 +86,7 @@ const relationshipPoints = [
}] }]
}, },
{ {
coordinates: [-87.6298, 41.8781], coordinates: [-87.6298, 41.8781] as Coordinates,
city: "Chicago", city: "Chicago",
state: "Illinois", state: "Illinois",
events: [{ events: [{
@ -81,7 +97,7 @@ const relationshipPoints = [
}] }]
}, },
{ {
coordinates: [-98.4936, 29.4241], coordinates: [-98.4936, 29.4241] as Coordinates,
city: "San Antonio", city: "San Antonio",
state: "Texas", state: "Texas",
events: [{ events: [{
@ -92,7 +108,7 @@ const relationshipPoints = [
}] }]
}, },
{ {
coordinates: [-89.4012, 43.0731], coordinates: [-89.4012, 43.0731] as Coordinates,
city: "Madison", city: "Madison",
state: "Wisconsin", state: "Wisconsin",
events: [{ events: [{
@ -103,7 +119,7 @@ const relationshipPoints = [
}] }]
}, },
{ {
coordinates: [-94.8191, 38.8814], coordinates: [-94.8191, 38.8814] as Coordinates,
city: "Olathe", city: "Olathe",
state: "Kansas", state: "Kansas",
events: [{ events: [{
@ -114,7 +130,7 @@ const relationshipPoints = [
}] }]
}, },
{ {
coordinates: [-115.1398, 36.1699], coordinates: [-115.1398, 36.1699] as Coordinates,
city: "Las Vegas", city: "Las Vegas",
state: "Nevada", state: "Nevada",
events: [{ events: [{