Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
8cc503b
fix: Added Control property to task sidebar
lyt3ral Aug 17, 2025
9a056ba
chore: update dependencies and improve Docker configuration
Marfuen Aug 18, 2025
4c78c9b
Merge branch 'main' into fix/control-field-task
Marfuen Aug 18, 2025
1fce37a
Merge pull request #1323 from lyt3ral/fix/control-field-task
Marfuen Aug 18, 2025
96c7f80
chore: update Docker configuration and enhance authentication flow
Marfuen Aug 18, 2025
77e28b2
chore: update environment configuration and enhance documentation
Marfuen Aug 19, 2025
e3d3f10
chore: update dependencies and improve Docker configuration
Marfuen Aug 19, 2025
09349ca
Merge pull request #1326 from trycompai/mariano/docker
Marfuen Aug 19, 2025
27a7254
fix: enhance session token retrieval in middleware
Marfuen Aug 19, 2025
6c24ca2
Merge pull request #1328 from trycompai/mariano/docker
Marfuen Aug 19, 2025
d74cbde
chore: remove obsolete Dockerfiles for app and portal
Marfuen Aug 19, 2025
27e9bf2
chore: update Dockerfile to use Node.js 22-alpine for app and portal
Marfuen Aug 19, 2025
c345432
Merge pull request #1329 from trycompai/mariano/docker
Marfuen Aug 19, 2025
5c50ccf
chore: update trigger.dev SDK and dependencies for improved functiona…
Marfuen Aug 19, 2025
24df405
Merge pull request #1330 from trycompai/mariano/docker
Marfuen Aug 19, 2025
62fbd4f
Merge branch 'release' into main
Marfuen Aug 19, 2025
e3fb7d3
feat: enhance invitation handling and user redirection
Marfuen Aug 19, 2025
eb9bcab
feat: improve invite page handling and user feedback
Marfuen Aug 19, 2025
198559a
Merge pull request #1331 from trycompai/mariano/docker
Marfuen Aug 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# Database Configuration
# Database Configuration - Required
DATABASE_URL="postgresql://postgres:pass@127.0.0.1:5432/comp"

# Authentication
# Authentication - Required
AUTH_SECRET=your-secret-auth-key-here-min-32-chars

# Optional
AUTH_GOOGLE_ID=your-google-oauth-client-id
AUTH_GOOGLE_SECRET=your-google-oauth-client-secret
AUTH_GITHUB_ID=your-github-oauth-app-id
AUTH_GITHUB_SECRET=your-github-oauth-app-secret

# Email Service
# Email Service - Required for OTP and Magic Link
RESEND_API_KEY=re_your_resend_api_key_here

# Application URLs
Expand All @@ -18,7 +20,7 @@ NEXT_PUBLIC_VERCEL_URL=http://localhost:3000
# Security
REVALIDATION_SECRET=your-revalidation-secret-here

# Optional - Redis/Upstash (for caching)
# Required - Redis/Upstash (for caching)
UPSTASH_REDIS_REST_URL=your-upstash-redis-url
UPSTASH_REDIS_REST_TOKEN=your-upstash-redis-token

Expand All @@ -28,16 +30,18 @@ APP_AWS_SECRET_ACCESS_KEY=your-aws-secret-key
APP_AWS_REGION=us-east-1
APP_AWS_BUCKET_NAME=your-s3-bucket-name

# Optional - OpenAI
# Optional - for AI features
OPENAI_API_KEY=sk-your-openai-api-key

# Optional - Analytics
NEXT_PUBLIC_POSTHOG_KEY=your-posthog-key
NEXT_PUBLIC_POSTHOG_HOST=https://app.posthog.com

# Optional - External Services
# Required - External Services
TRIGGER_SECRET_KEY=your-trigger-secret
TRIGGER_API_KEY=your-trigger-api-key

# Required - Chat and research with AI
GROQ_API_KEY=your-groq-api-key
FIRECRAWL_API_KEY=your-firecrawl-key

Expand Down
90 changes: 59 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ WORKDIR /app
# Copy workspace configuration
COPY package.json bun.lock ./

# Copy package.json files for all packages
COPY packages/db/package.json ./packages/db/
# Copy package.json files for all packages (exclude local db; use published @trycompai/db)
COPY packages/kv/package.json ./packages/kv/
COPY packages/ui/package.json ./packages/ui/
COPY packages/email/package.json ./packages/email/
Expand All @@ -23,7 +22,7 @@ COPY apps/app/package.json ./apps/app/
COPY apps/portal/package.json ./apps/portal/

# Install all dependencies
RUN PRISMA_SKIP_POSTINSTALL_GENERATE=true bun install --frozen-lockfile
RUN PRISMA_SKIP_POSTINSTALL_GENERATE=true bun install

# =============================================================================
# STAGE 2: Ultra-Minimal Migrator - Only Prisma
Expand All @@ -32,20 +31,18 @@ FROM oven/bun:1.2.8 AS migrator

WORKDIR /app

# Copy Prisma schema and migration files
# Copy local Prisma schema and migrations from workspace
COPY packages/db/prisma ./packages/db/prisma

# Create minimal package.json for Prisma
RUN echo '{"name":"migrator","type":"module","dependencies":{"prisma":"^6.13.0","@prisma/client":"^6.13.0"}}' > package.json
# Create minimal package.json for Prisma runtime (also used by seeder)
RUN echo '{"name":"migrator","type":"module","dependencies":{"prisma":"^6.14.0","@prisma/client":"^6.14.0","@trycompai/db":"^1.3.4","zod":"^3.25.7"}}' > package.json

# Install ONLY Prisma dependencies
RUN bun install

# Generate Prisma client
RUN cd packages/db && bunx prisma generate

# Default command for migrations
CMD ["bunx", "prisma", "migrate", "deploy", "--schema=packages/db/prisma/schema.prisma"]
# Run migrations against the combined schema published by @trycompai/db
RUN echo "Running migrations against @trycompai/db combined schema"
CMD ["bunx", "prisma", "migrate", "deploy", "--schema=node_modules/@trycompai/db/dist/schema.prisma"]

# =============================================================================
# STAGE 3: App Builder
Expand All @@ -58,28 +55,52 @@ WORKDIR /app
COPY packages ./packages
COPY apps/app ./apps/app

# Generate Prisma client in the full workspace context
RUN cd packages/db && bunx prisma generate
# Bring in node_modules for build and prisma prebuild
COPY --from=deps /app/node_modules ./node_modules

# Ensure Next build has required public env at build-time
ARG NEXT_PUBLIC_BETTER_AUTH_URL
ARG NEXT_PUBLIC_PORTAL_URL
ARG NEXT_PUBLIC_POSTHOG_KEY
ARG NEXT_PUBLIC_POSTHOG_HOST
ARG NEXT_PUBLIC_IS_DUB_ENABLED
ARG NEXT_PUBLIC_GTM_ID
ARG NEXT_PUBLIC_LINKEDIN_PARTNER_ID
ARG NEXT_PUBLIC_LINKEDIN_CONVERSION_ID
ARG NEXT_PUBLIC_GOOGLE_ADS_CONVERSION_LABEL
ARG NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_BETTER_AUTH_URL=$NEXT_PUBLIC_BETTER_AUTH_URL \
NEXT_PUBLIC_PORTAL_URL=$NEXT_PUBLIC_PORTAL_URL \
NEXT_PUBLIC_POSTHOG_KEY=$NEXT_PUBLIC_POSTHOG_KEY \
NEXT_PUBLIC_POSTHOG_HOST=$NEXT_PUBLIC_POSTHOG_HOST \
NEXT_PUBLIC_IS_DUB_ENABLED=$NEXT_PUBLIC_IS_DUB_ENABLED \
NEXT_PUBLIC_GTM_ID=$NEXT_PUBLIC_GTM_ID \
NEXT_PUBLIC_LINKEDIN_PARTNER_ID=$NEXT_PUBLIC_LINKEDIN_PARTNER_ID \
NEXT_PUBLIC_LINKEDIN_CONVERSION_ID=$NEXT_PUBLIC_LINKEDIN_CONVERSION_ID \
NEXT_PUBLIC_GOOGLE_ADS_CONVERSION_LABEL=$NEXT_PUBLIC_GOOGLE_ADS_CONVERSION_LABEL \
NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL \
NEXT_TELEMETRY_DISABLED=1 NODE_ENV=production \
NEXT_OUTPUT_STANDALONE=true \
NODE_OPTIONS=--max_old_space_size=6144

# Build the app
RUN cd apps/app && SKIP_ENV_VALIDATION=true bun run build

# =============================================================================
# STAGE 4: App Production
# =============================================================================
FROM oven/bun:1.2.8 AS app
FROM node:22-alpine AS app

WORKDIR /app

# Copy the built app and all necessary dependencies from builder
COPY --from=app-builder /app/apps/app/.next ./apps/app/.next
COPY --from=app-builder /app/apps/app/package.json ./apps/app/
COPY --from=app-builder /app/package.json ./
COPY --from=app-builder /app/node_modules ./node_modules
COPY --from=app-builder /app/packages ./packages
# Copy Next standalone output
COPY --from=app-builder /app/apps/app/.next/standalone ./
COPY --from=app-builder /app/apps/app/.next/static ./apps/app/.next/static
COPY --from=app-builder /app/apps/app/public ./apps/app/public


EXPOSE 3000
CMD ["bun", "run", "--cwd", "apps/app", "start"]
CMD ["node", "apps/app/server.js"]

# =============================================================================
# STAGE 5: Portal Builder
Expand All @@ -92,25 +113,32 @@ WORKDIR /app
COPY packages ./packages
COPY apps/portal ./apps/portal

# Generate Prisma client
RUN cd packages/db && bunx prisma generate
# Bring in node_modules for build and prisma prebuild
COPY --from=deps /app/node_modules ./node_modules

# Ensure Next build has required public env at build-time
ARG NEXT_PUBLIC_BETTER_AUTH_URL
ENV NEXT_PUBLIC_BETTER_AUTH_URL=$NEXT_PUBLIC_BETTER_AUTH_URL \
NEXT_TELEMETRY_DISABLED=1 NODE_ENV=production \
NEXT_OUTPUT_STANDALONE=true \
NODE_OPTIONS=--max_old_space_size=6144

# Build the portal
RUN cd apps/portal && SKIP_ENV_VALIDATION=true bun run build

# =============================================================================
# STAGE 6: Portal Production
# =============================================================================
FROM oven/bun:1.2.8 AS portal
FROM node:22-alpine AS portal

WORKDIR /app

# Copy the built portal and all necessary dependencies from builder
COPY --from=portal-builder /app/apps/portal/.next ./apps/portal/.next
COPY --from=portal-builder /app/apps/portal/package.json ./apps/portal/
COPY --from=portal-builder /app/package.json ./
COPY --from=portal-builder /app/node_modules ./node_modules
COPY --from=portal-builder /app/packages ./packages
# Copy Next standalone output for portal
COPY --from=portal-builder /app/apps/portal/.next/standalone ./
COPY --from=portal-builder /app/apps/portal/.next/static ./apps/portal/.next/static
COPY --from=portal-builder /app/apps/portal/public ./apps/portal/public

EXPOSE 3000
CMD ["bun", "run", "--cwd", "apps/portal", "start"]
CMD ["node", "apps/portal/server.js"]

# (Trigger.dev hosted; no local runner stage)
Loading
Loading