3 min readv1.0.68
Deployment Options & Cloud Hosting
Deploying LaterBox Web and Supabase backend to Cloudflare Pages, Vercel, Docker, or AWS.
Deploying to Cloudflare Pages#
LaterBox Web is optimized for Cloudflare Pages and Next.js OpenNext:
- Connect GitHub Repository in Cloudflare Pages dashboard.
- Build Settings:
- Framework Preset:
Next.js - Root directory:
laterbox-web - Build command:
npm run build - Build output directory:
.nextor.open-next/assets
- Environment Variables: Add
NEXT_PUBLIC_SUPABASE_URL,NEXT_PUBLIC_SUPABASE_ANON_KEY, andSUPABASE_SERVICE_ROLE_KEY. - Custom Domain: Bind
laterbox.devanddocs.laterbox.devin the Cloudflare Pages custom domains settings.
Deploying to Vercel#
- Import the
laterboxrepository in [Vercel Dashboard](https://vercel.com). - Set Root Directory to
laterbox-web. - Add your environment variables in the Project Settings.
- Click Deploy. Vercel will build and prerender all 35+ routes automatically.
Deploying with Docker#
To run the web app in a containerized environment (e.g. Kubernetes, AWS ECS, DigitalOcean App Platform):
dockerfile
# Dockerfile for laterbox-web
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 3000
CMD ["node", "server.js"]bash
# Build and run Docker image
docker build -t laterbox-web ./laterbox-web
docker run -p 3000:3000 --env-file .env.local laterbox-webDeploying Edge Functions#
Deploy your Supabase Edge Functions globally:
bash
# Login to Supabase CLI
supabase login
# Deploy enrich-url function
supabase functions deploy enrich-url --project-ref your-project-idQuestions or suggestions for this documentation?