Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 015386ba4a | |||
| 49abaaf2fd | |||
| 7e9005e338 | |||
| bbcc7d159c |
@@ -316,6 +316,9 @@ jobs:
|
|||||||
S3_BUCKET=${{ secrets.S3_BUCKET || vars.S3_BUCKET || 'mintel' }}
|
S3_BUCKET=${{ secrets.S3_BUCKET || vars.S3_BUCKET || 'mintel' }}
|
||||||
S3_REGION=${{ secrets.S3_REGION || vars.S3_REGION || 'fsn1' }}
|
S3_REGION=${{ secrets.S3_REGION || vars.S3_REGION || 'fsn1' }}
|
||||||
S3_PREFIX=${{ secrets.S3_PREFIX || vars.S3_PREFIX || 'mintel.me' }}
|
S3_PREFIX=${{ secrets.S3_PREFIX || vars.S3_PREFIX || 'mintel.me' }}
|
||||||
|
DATABASE_URI=${{ secrets.DATABASE_URI || (needs.prepare.outputs.target == 'testing' && secrets.TESTING_DIRECTUS_DB_PASSWORD && format('postgres://directus:{0}@postgres-db:5432/directus', secrets.TESTING_DIRECTUS_DB_PASSWORD)) || 'postgres://payload:payload@postgres-db:5432/payload' }}
|
||||||
|
PAYLOAD_SECRET=${{ secrets.PAYLOAD_SECRET || 'secret' }}
|
||||||
|
BUILD_ID=${{ github.sha }}
|
||||||
tags: registry.infra.mintel.me/mintel/mintel.me:${{ needs.prepare.outputs.image_tag }}
|
tags: registry.infra.mintel.me/mintel/mintel.me:${{ needs.prepare.outputs.image_tag }}
|
||||||
cache-from: type=registry,ref=registry.infra.mintel.me/mintel/mintel.me:buildcache-${{ needs.prepare.outputs.target }}
|
cache-from: type=registry,ref=registry.infra.mintel.me/mintel/mintel.me:buildcache-${{ needs.prepare.outputs.target }}
|
||||||
cache-to: type=registry,ref=registry.infra.mintel.me/mintel/mintel.me:buildcache-${{ needs.prepare.outputs.target }},mode=max
|
cache-to: type=registry,ref=registry.infra.mintel.me/mintel/mintel.me:buildcache-${{ needs.prepare.outputs.target }},mode=max
|
||||||
|
|||||||
23
Dockerfile
23
Dockerfile
@@ -13,6 +13,9 @@ ARG S3_SECRET_KEY
|
|||||||
ARG S3_BUCKET
|
ARG S3_BUCKET
|
||||||
ARG S3_REGION
|
ARG S3_REGION
|
||||||
ARG S3_PREFIX
|
ARG S3_PREFIX
|
||||||
|
ARG DATABASE_URI
|
||||||
|
ARG PAYLOAD_SECRET
|
||||||
|
ARG BUILD_ID
|
||||||
|
|
||||||
# Environment variables for Next.js build
|
# Environment variables for Next.js build
|
||||||
ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL
|
ENV NEXT_PUBLIC_BASE_URL=$NEXT_PUBLIC_BASE_URL
|
||||||
@@ -24,6 +27,8 @@ ENV S3_SECRET_KEY=$S3_SECRET_KEY
|
|||||||
ENV S3_BUCKET=$S3_BUCKET
|
ENV S3_BUCKET=$S3_BUCKET
|
||||||
ENV S3_REGION=$S3_REGION
|
ENV S3_REGION=$S3_REGION
|
||||||
ENV S3_PREFIX=$S3_PREFIX
|
ENV S3_PREFIX=$S3_PREFIX
|
||||||
|
ENV DATABASE_URI=$DATABASE_URI
|
||||||
|
ENV PAYLOAD_SECRET=$PAYLOAD_SECRET
|
||||||
ENV SKIP_RUNTIME_ENV_VALIDATION=true
|
ENV SKIP_RUNTIME_ENV_VALIDATION=true
|
||||||
ENV CI=true
|
ENV CI=true
|
||||||
|
|
||||||
@@ -47,10 +52,14 @@ RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
|
|||||||
rm .npmrc
|
rm .npmrc
|
||||||
|
|
||||||
# Copy source code
|
# Copy source code
|
||||||
|
# We use BUILD_ID here to ensure that if the commit changes, we always COPY the latest files
|
||||||
|
# even if Docker's metadata-based fingerprinting for the public directory fails.
|
||||||
|
ARG BUILD_ID
|
||||||
|
RUN echo "Building with ID: ${BUILD_ID}"
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Build application (monorepo filter)
|
# Build application (monorepo filter)
|
||||||
ENV NODE_OPTIONS="--max_old_space_size=4096"
|
ENV NODE_OPTIONS="--max_old_space_size=8192"
|
||||||
RUN pnpm --filter @mintel/web build
|
RUN pnpm --filter @mintel/web build
|
||||||
|
|
||||||
# Stage 2: Runner
|
# Stage 2: Runner
|
||||||
@@ -65,6 +74,14 @@ COPY --from=builder /app/apps/web/.next/static ./apps/web/.next/static
|
|||||||
|
|
||||||
# Explicitly copy Payload dynamically generated importMap.js excluded by Standalone tracing
|
# Explicitly copy Payload dynamically generated importMap.js excluded by Standalone tracing
|
||||||
COPY --from=builder /app/apps/web/app/(payload)/admin/importMap.js ./apps/web/app/(payload)/admin/importMap.js
|
COPY --from=builder /app/apps/web/app/(payload)/admin/importMap.js ./apps/web/app/(payload)/admin/importMap.js
|
||||||
|
|
||||||
|
# Fix permissions for the non-root user (Standard uid/gid from base image)
|
||||||
|
# We do this as root before switching users
|
||||||
|
USER root
|
||||||
|
RUN chown -R 1001:65533 /app
|
||||||
|
USER nextjs
|
||||||
|
|
||||||
# Start from the app directory to ensure references solve correctly
|
# Start from the app directory to ensure references solve correctly
|
||||||
WORKDIR /app/apps/web
|
# In Standalone mode, Next.js expects node_modules and public relative to the server.js
|
||||||
CMD ["node", "server.js"]
|
WORKDIR /app
|
||||||
|
CMD ["node", "apps/web/server.js"]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
FROM node:20-alpine
|
FROM node:20-alpine
|
||||||
|
|
||||||
# Install essential build tools if needed (e.g., for node-gyp)
|
# Install essential build tools if needed (e.g., for node-gyp)
|
||||||
RUN apk add --no-cache libc6-compat python3 make g++
|
RUN apk add --no-cache libc6-compat git python3 make g++
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|||||||
@@ -196,11 +196,13 @@ export const IframeSection: React.FC<IframeSectionProps> = ({
|
|||||||
|
|
||||||
const updateScrollState = React.useCallback(() => {
|
const updateScrollState = React.useCallback(() => {
|
||||||
try {
|
try {
|
||||||
|
const win = iframeRef.current?.contentWindow;
|
||||||
const doc = iframeRef.current?.contentDocument?.documentElement;
|
const doc = iframeRef.current?.contentDocument?.documentElement;
|
||||||
if (doc) {
|
if (doc && win) {
|
||||||
const atTop = doc.scrollTop <= 5;
|
const scrollTop = doc.scrollTop || win.scrollY || 0;
|
||||||
|
const atTop = scrollTop <= 5;
|
||||||
const atBottom =
|
const atBottom =
|
||||||
doc.scrollTop + doc.clientHeight >= doc.scrollHeight - 5;
|
scrollTop + doc.clientHeight >= doc.scrollHeight - 5;
|
||||||
const isScrollable = doc.scrollHeight > doc.clientHeight + 10;
|
const isScrollable = doc.scrollHeight > doc.clientHeight + 10;
|
||||||
setScrollState({ atTop, atBottom, isScrollable });
|
setScrollState({ atTop, atBottom, isScrollable });
|
||||||
}
|
}
|
||||||
@@ -493,7 +495,6 @@ export const IframeSection: React.FC<IframeSectionProps> = ({
|
|||||||
style.textContent = `
|
style.textContent = `
|
||||||
*::-webkit-scrollbar { display: none !important; }
|
*::-webkit-scrollbar { display: none !important; }
|
||||||
* { -ms-overflow-style: none !important; scrollbar-width: none !important; }
|
* { -ms-overflow-style: none !important; scrollbar-width: none !important; }
|
||||||
body { background: transparent !important; }
|
|
||||||
`;
|
`;
|
||||||
iframe.contentDocument.head.appendChild(style);
|
iframe.contentDocument.head.appendChild(style);
|
||||||
setTimeout(updateAmbilight, 600);
|
setTimeout(updateAmbilight, 600);
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ services:
|
|||||||
# - CI=true
|
# - CI=true
|
||||||
- NPM_TOKEN=${NPM_TOKEN:-}
|
- NPM_TOKEN=${NPM_TOKEN:-}
|
||||||
- DATABASE_URI=postgres://${postgres_DB_USER:-payload}:${postgres_DB_PASSWORD:-payload}@postgres-db:5432/${postgres_DB_NAME:-payload}
|
- DATABASE_URI=postgres://${postgres_DB_USER:-payload}:${postgres_DB_PASSWORD:-payload}@postgres-db:5432/${postgres_DB_NAME:-payload}
|
||||||
|
- QDRANT_URL=http://qdrant:6333
|
||||||
- PAYLOAD_SECRET=dev-secret
|
- PAYLOAD_SECRET=dev-secret
|
||||||
command: >
|
command: >
|
||||||
sh -c "pnpm install --no-frozen-lockfile && pnpm --filter @mintel/web dev"
|
sh -c "pnpm install --no-frozen-lockfile && pnpm --filter @mintel/web dev"
|
||||||
|
|||||||
36
scripts/visual_debug.mjs
Normal file
36
scripts/visual_debug.mjs
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
import puppeteer from 'puppeteer';
|
||||||
|
|
||||||
|
(async () => {
|
||||||
|
// Launch browser
|
||||||
|
const browser = await puppeteer.launch({ headless: true });
|
||||||
|
const page = await browser.newPage();
|
||||||
|
|
||||||
|
// Set viewport
|
||||||
|
await page.setViewport({ width: 1920, height: 1080 });
|
||||||
|
|
||||||
|
try {
|
||||||
|
console.log("Navigating to case study page...");
|
||||||
|
await page.goto('https://mintel.me/case-studies/klz-cables', { waitUntil: 'networkidle2' });
|
||||||
|
|
||||||
|
console.log("Waiting a bit for iframes to load...");
|
||||||
|
await new Promise(r => setTimeout(r, 5000));
|
||||||
|
|
||||||
|
// Let's get console logs from the page too
|
||||||
|
page.on('console', msg => console.log('PAGE LOG:', msg.text()));
|
||||||
|
|
||||||
|
console.log("Taking screenshot...");
|
||||||
|
await page.screenshot({ path: '/Users/marcmintel/Projects/mintel.me/screenshot_case_study.png', fullPage: true });
|
||||||
|
|
||||||
|
// Also take a screenshot of the actual showcase HTML page directly to compare
|
||||||
|
console.log("Navigating directly to showcase HTML...");
|
||||||
|
await page.goto('https://mintel.me/showcase/klz-cables.com/power-cables-medium-voltage-cables.html', { waitUntil: 'networkidle2' });
|
||||||
|
await new Promise(r => setTimeout(r, 3000));
|
||||||
|
await page.screenshot({ path: '/Users/marcmintel/Projects/mintel.me/screenshot_showcase.png', fullPage: true });
|
||||||
|
|
||||||
|
console.log("Done!");
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Error:", e);
|
||||||
|
} finally {
|
||||||
|
await browser.close();
|
||||||
|
}
|
||||||
|
})();
|
||||||
1
wget_out.txt
Normal file
1
wget_out.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
zsh:1: command not found: wget
|
||||||
Reference in New Issue
Block a user