diff --git a/Dockerfile b/Dockerfile index e8412a2..0b9e7ab 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,10 @@ # Build stage FROM node:14 AS build +# Add a cache busting argument +ARG CACHEBUST=1 +RUN echo "Cache bust: $CACHEBUST" + WORKDIR /app # Copy package.json and package-lock.json diff --git a/client/src/components/Minutes.tsx b/client/src/components/Minutes.tsx index 78f1f1d..3d279aa 100644 --- a/client/src/components/Minutes.tsx +++ b/client/src/components/Minutes.tsx @@ -34,7 +34,7 @@ const minutesData: MinuteEntry[] = [ fileUrl: '/minutes/minutes-08062024.pdf', }, ]; - + const Minutes: React.FC = () => { const [sortColumn, setSortColumn] = useState('date'); const [sortDirection, setSortDirection] = useState<'asc' | 'desc'>('desc'); diff --git a/cline_docs/activeContext.md b/cline_docs/activeContext.md index e2bad3e..121ffc0 100644 --- a/cline_docs/activeContext.md +++ b/cline_docs/activeContext.md @@ -15,11 +15,19 @@ Adding new meeting minutes to the website: ## Next Steps 1. Deploy changes through Portainer: - - Log into Portainer dashboard - - Find "Containers" in left menu - - Locate "mcdi-website" container - - Click refresh/recreate icon (🔄) - - Wait for container to rebuild (~2 minutes) + - Previous solution (updating VERSION) was already tried and didn't work + - New solution implemented: Added CACHEBUST build argument to force rebuild + * Added build arg CACHEBUST to docker-compose.yml + * Modified Dockerfile to use the CACHEBUST argument + - Next actions: + a. Commit and push changes to git repository + b. In Portainer, go to Stacks > mcdi-website + c. Set CACHEBUST environment variable to current timestamp (e.g., CACHEBUST=1616789123) + d. Click "Pull and redeploy" or equivalent option + e. Wait for container to rebuild (~2 minutes) + f. If still not working, try alternative solutions: + - Modify Portainer stack settings to use "Build" instead of "Pull" + - Check Portainer webhook URL configuration ## Technical Notes - Website uses React with TypeScript diff --git a/cline_docs/progress.md b/cline_docs/progress.md index 3180f76..191a9bb 100644 --- a/cline_docs/progress.md +++ b/cline_docs/progress.md @@ -18,13 +18,19 @@ - Updated Minutes.tsx component - Reordered minutes data from newest (top) to oldest (bottom) in the source array -2. Deployment: - - Changes ready for deployment via Portainer - - Container rebuild pending +2. Deployment (in progress): + - Changes pushed to git repository + - Encountered issues with Portainer not detecting git changes + - Previous solution (updating VERSION from 1.7 to 1.8 to 1.9) didn't work + - New solution implemented: Added CACHEBUST build argument to force rebuild + * Added build arg to docker-compose.yml + * Modified Dockerfile to use the CACHEBUST argument + - Ready for commit, push, and redeploy in Portainer with CACHEBUST variable ## What's Left 1. Immediate: - - Deploy changes through Portainer + - Commit and push docker-compose.yml and Dockerfile changes + - Deploy changes through Portainer with CACHEBUST environment variable - Verify all meeting minutes are accessible - Test PDF viewing on desktop and mobile diff --git a/docker-compose.yml b/docker-compose.yml index fc41be6..f434c5d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -4,12 +4,14 @@ services: build: context: . dockerfile: Dockerfile + args: + CACHEBUST: ${CACHEBUST:-1} pull_policy: build ports: - "801:801" environment: - NODE_ENV=production - - VERSION=1.9 + - VERSION=1.10 env_file: - .env networks: @@ -17,4 +19,4 @@ services: networks: caddy_network: - external: true \ No newline at end of file + external: true