QUESTPIE
Operate in Production

Deployment

Docker deployment, environment variables, and production hardening.

Docker

QUESTPIE apps can be containerized with Docker:

Dockerfile
FROM oven/bun:1 AS base
WORKDIR /app

FROM base AS build
COPY package.json bun.lockb ./
RUN bun install --frozen-lockfile
COPY . .
RUN bunx questpie generate
RUN bun run build

FROM base AS production
COPY --from=build /app/.output /app/.output
EXPOSE 3000
CMD ["bun", "run", ".output/server/index.mjs"]

Environment Variables

VariableRequiredDescription
DATABASE_URLYesPostgreSQL connection string
APP_URLYesPublic URL
APP_SECRET / BETTER_AUTH_SECRETYesSession secret
SMTP_HOSTNoEmail SMTP host
SMTP_PORTNoEmail SMTP port
REDIS_URLNoRedis URL (for KV, realtime)
S3_BUCKETNoS3 bucket name
S3_REGIONNoS3 region
S3_ACCESS_KEYNoS3 access key
S3_SECRET_KEYNoS3 secret key

Production Checklist

  • Set strong APP_SECRET (min 32 characters)
  • Use production DATABASE_URL with SSL
  • Run questpie migrate:up before deploying
  • Configure SMTP for transactional email
  • Set APP_URL to your public domain
  • Enable HTTPS
  • Configure S3 or persistent storage for uploads
  • Use redisStreamsAdapter if running multiple instances
  • Set up health checks

Health Check

Add a health check endpoint:

routes/health.ts
import { route } from "questpie";

export default route({
	method: "GET",
	handler: async ({ db }) => {
		await db.execute(sql`SELECT 1`);
		return new Response(JSON.stringify({ status: "ok" }), {
			headers: { "Content-Type": "application/json" },
		});
	},
});

On this page