Docs/Deployment/Deployment Options & Cloud Hosting
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:

  1. Connect GitHub Repository in Cloudflare Pages dashboard.
  2. Build Settings:
  • Framework Preset: Next.js
  • Root directory: laterbox-web
  • Build command: npm run build
  • Build output directory: .next or .open-next/assets
  1. Environment Variables: Add NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_ANON_KEY, and SUPABASE_SERVICE_ROLE_KEY.
  2. Custom Domain: Bind laterbox.dev and docs.laterbox.dev in the Cloudflare Pages custom domains settings.

Deploying to Vercel#

  1. Import the laterbox repository in [Vercel Dashboard](https://vercel.com).
  2. Set Root Directory to laterbox-web.
  3. Add your environment variables in the Project Settings.
  4. 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-web

Deploying 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-id
Questions or suggestions for this documentation?