diff --git a/.gitignore b/.gitignore index ea90594..a4af855 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ .DS_Store build/ node_modules/ +server/dist/ diff --git a/Dockerfile b/Dockerfile index 0b9e7ab..b4ad5a8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,71 +1,62 @@ # Build stage -FROM node:14 AS build +FROM node:22-alpine AS build -# Add a cache busting argument ARG CACHEBUST=1 RUN echo "Cache bust: $CACHEBUST" +# Build tools needed for argon2 native compilation +RUN apk add --no-cache python3 make g++ + WORKDIR /app - -# Copy package.json and package-lock.json + +# Install dependencies first (cache layer) COPY .env ./.env COPY package*.json ./ COPY client/package*.json ./client/ COPY server/package*.json ./server/ -# Install dependencies -RUN cd client && npm cache clean --force && rm -rf node_modules && npm install +RUN cd client && npm install RUN cd server && npm install -# Copy the entire client directory structure +# Copy static assets COPY client/public/headshots ./client/public/headshots -COPY client/public/logos ./client/public/logos -COPY client/public/photos ./client/public/photos -COPY client/public/sponsors ./client/public/sponsors -COPY client/public/videos ./client/public/videos -COPY client/public/minutes ./client/public/minutes +COPY client/public/logos ./client/public/logos +COPY client/public/photos ./client/public/photos +COPY client/public/sponsors ./client/public/sponsors +COPY client/public/videos ./client/public/videos +COPY client/public/minutes ./client/public/minutes COPY client/public/*.* ./client/public/ - -# Copy source code -COPY client/src ./client/src -COPY client/*.js ./client/ +# Copy source +COPY client/src ./client/src +COPY client/*.js ./client/ COPY client/*.json ./client/ -COPY server ./server - -# Install required packages -RUN npm install nodemailer dotenv date-fns react-icons +COPY server/src ./server/src +COPY server/tsconfig.json ./server/ # Build client RUN cd client && npm run build -# Install all dependencies including devDependencies -RUN cd server && npm install - # Build server -RUN cd server && npm run build - -# Remove devDependencies -RUN cd server && npm prune --production +RUN cd server && npm run build && npm prune --production # Production stage -FROM node:14-alpine +FROM node:22-alpine + +RUN apk add --no-cache python3 make g++ WORKDIR /app -# Copy built assets and static files from build stage COPY --from=build /app/client/build ./client/build -COPY --from=build /app/server ./server +COPY --from=build /app/server/dist ./server/dist +COPY --from=build /app/server/node_modules ./server/node_modules +COPY --from=build /app/server/package.json ./server/package.json COPY --from=build /app/.env ./.env -# Set working directory to server +RUN mkdir -p uploads/headshots uploads/photos uploads/sponsors uploads/minutes + WORKDIR /app/server -# Install production dependencies -RUN npm install --only=production - -# Expose port EXPOSE 801 -# Start the server -CMD ["npm", "start"] +CMD ["node", "dist/index.js"] diff --git a/client/src/App.tsx b/client/src/App.tsx index f96ff9a..36b0132 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -14,29 +14,35 @@ import VideoGallery from './components/VideoGallery'; import Resources from './components/Resources'; /* import ComingSoon from './components/ComingSoon'; */ import JoinMCDi from './components/JoinMCDi'; +import Manage from './components/Manage'; const App: React.FC = () => { return ( -
-
-
- - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - } /> - -
-
-
+ + } /> + +
+
+ + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + } /> + +
+