This commit is contained in:
2025-12-15 13:34:27 +01:00
parent 129c63c362
commit 021feaf51e
19 changed files with 6548 additions and 1318 deletions

View File

@@ -0,0 +1,20 @@
node_modules
.next
dist
.env
.env.local
.env.*.local
Dockerfile*
docker-compose.*
.git
.gitignore
README.md
npm-debug.log
yarn-debug.log
yarn-error.log
.DS_Store
*.md
.vscode
.idea
coverage
.turbo

View File

@@ -0,0 +1,23 @@
FROM node:20-alpine
WORKDIR /app
# Install bash for better shell capabilities
RUN apk add --no-cache bash
# Copy root package.json and install dependencies
COPY package.json package-lock.json ./
RUN npm ci
RUN find ./node_modules -name "next" -print || true # Debugging line
# Copy apps/website and packages for development
COPY apps/website apps/website/
COPY packages packages/
COPY apps/website/tsconfig.json apps/website/
COPY scripts scripts/
COPY tsconfig.base.json ./
EXPOSE 3000
# Run from the correct workspace context
CMD ["npm", "run", "dev", "--workspace=@gridpilot/website"]

View File

@@ -0,0 +1,48 @@
FROM node:20-alpine AS builder
WORKDIR /app
# Copy package files and install dependencies
COPY package.json package-lock.json ./
RUN npm ci
# Copy apps/website, packages, and config for building
COPY apps/website apps/website/
COPY packages packages/
COPY apps/website/tsconfig.json apps/website/
COPY scripts scripts/
COPY tsconfig.base.json ./
# Build the Next.js application
# Run from the root workspace context
RUN node ./node_modules/next/dist/bin/next build
# Production stage: slim image with only production dependencies and built files
FROM node:20-alpine AS production_final
WORKDIR /app
# Install wget for healthchecks
RUN apk add --no-cache wget
# Copy package files and install production dependencies only
COPY --from=builder /app/package.json ./
COPY --from=builder /app/package-lock.json ./
RUN npm ci --omit=dev
# Copy built Next.js application
COPY --from=builder /app/apps/website/.next ./apps/website/.next
COPY --from=builder /app/apps/website/public ./apps/website/public
COPY --from=builder /app/apps/website/package.json ./apps/website/package.json
COPY --from=builder /app/apps/website/next.config.mjs ./apps/website/next.config.mjs
# Copy packages (needed for runtime dependencies)
COPY --from=builder /app/packages ./packages
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
# Run Next.js in production mode from the root workspace context
CMD ["node", "./node_modules/next/dist/bin/next", "start"]

View File

@@ -2,6 +2,8 @@
const nextConfig = {
reactStrictMode: true,
// Fix for Next.js 13+ Turbopack in monorepos to correctly identify the workspace root
outputFileTracingRoot: '../../',
images: {
remotePatterns: [
{
@@ -17,9 +19,6 @@ const nextConfig = {
typescript: {
ignoreBuildErrors: false,
},
eslint: {
ignoreDuringBuilds: false,
},
transpilePackages: [
'@gridpilot/racing',
'@gridpilot/identity',