diff --git a/Caddyfile b/Caddyfile new file mode 100644 index 0000000..781a256 --- /dev/null +++ b/Caddyfile @@ -0,0 +1,11 @@ +:80 { + root * /usr/share/caddy + file_server + + # No cache, always update + header { + Cache-Control "no-cache, no-store, must-revalidate" + Pragma "no-cache" + Expires "0" + } +} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index e3bb463..8ac077f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,11 +10,13 @@ WORKDIR /app COPY package.json pnpm-lock.yaml ./ RUN pnpm install --frozen-lockfile -# Copy all +# Copy all and build COPY . . RUN pnpm build # --- DEPLOY --- FROM caddy:alpine COPY --from=build /app/dist /usr/share/caddy +COPY Caddyfile /etc/caddy/Caddyfile + EXPOSE 80 \ No newline at end of file diff --git a/Jenkinsfile b/Jenkinsfile index af7fdba..6803a7d 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -18,6 +18,9 @@ pipeline { steps { echo "Deploy new portfolio version..." sh "docker compose up -d" + + // Keep updated docker-compose.yml for safety + sh "cp docker-compose.yml /home/lucas/services/portfolio/docker-compose.yml" } } }