Skip to content

Deploying a Rallly App

Introduction

Rallly is an open-source scheduling and polling app for teams. Deploying Rallly with a Dockerfile on Klutch.sh gives you reproducible builds, managed secrets, and optional persistent storage—all configured from klutch.sh/app. This guide covers installation, Dockerfile setup, environment variables, storage, Nixpacks overrides, and sample checks to verify your deployment.


Prerequisites

  • A Klutch.sh account (sign up)
  • A GitHub repository containing your Rallly Dockerfile (GitHub is the only supported git source)
  • External PostgreSQL database
  • Optional SMTP credentials for email notifications

For onboarding, see the Quick Start.


Architecture and ports

  • Rallly serves HTTP on internal port 3000. Choose HTTP traffic in Klutch.sh and set the internal port to 3000.
  • Persistent storage is optional (e.g., for uploads if enabled). Primary data resides in Postgres.

Repository layout

rallly/
├── Dockerfile # Must be at repo root for auto-detection
└── README.md

Keep secrets out of Git; store them in Klutch.sh environment variables.


Installation (local) and starter commands

Build and run locally (ensure Postgres is reachable):

Terminal window
docker build -t rallly-local .
docker run -p 3000:3000 \
-e DATABASE_URL=postgres://user:pass@localhost:5432/rallly \
-e NEXTAUTH_SECRET=$(openssl rand -hex 32) \
-e NEXTAUTH_URL=http://localhost:3000 \
rallly-local

Dockerfile for Rallly (production-ready)

Place this at the repo root; Klutch.sh auto-detects Dockerfiles.

FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/package*.json ./
RUN npm ci --omit=dev
EXPOSE 3000
CMD ["npm", "run", "start"]

Notes:

  • Pin Node to the version Rallly supports; adjust if upstream changes.
  • Keep the Dockerfile at the repo root; Docker selection is automatic in Klutch.sh.

Environment variables (Klutch.sh)

Set these before deploying:

  • PORT=3000
  • DATABASE_URL=postgres://<user>:<password>@<host>:5432/<db>
  • NEXTAUTH_URL=https://example-app.klutch.sh
  • NEXTAUTH_SECRET=<secure-random-hex>
  • Optional SMTP/email: EMAIL_SERVER, EMAIL_FROM

If deploying without the Dockerfile and relying on Nixpacks:

  • NIXPACKS_NODE_VERSION=18
  • NIXPACKS_START_CMD=npm run start

Attach persistent volumes

If you store uploads or cache locally, add storage in Klutch.sh (path and size only):

  • /app/storage — optional uploads/cache.

Ensure the path matches your Rallly configuration.


Deploy Rallly on Klutch.sh (Dockerfile workflow)

  1. Push your repository—with the Dockerfile at the root—to GitHub.
  2. Open klutch.sh/app, create a project, and add an app.
  3. Select HTTP traffic and set the internal port to 3000.
  4. Add the environment variables above (database, NextAuth URL/secret, optional SMTP).
  5. Attach a volume at /app/storage if you need local persistence, sized for your media.
  6. Deploy. Your app will be reachable at https://example-app.klutch.sh; add a custom domain if desired.

Sample checks

Landing page:

Terminal window
curl -I https://example-app.klutch.sh

If you expose a health endpoint (replace if different):

Terminal window
curl -I https://example-app.klutch.sh/api/health

Health checks and production tips

  • Add an HTTP readiness probe to / or your health endpoint.
  • Keep NEXTAUTH_SECRET, DB credentials, and SMTP secrets in Klutch.sh secrets; rotate regularly.
  • Use external Postgres for durability; back it up on a schedule.
  • Pin Docker base versions and test upgrades in staging before production.
  • Monitor storage usage on /app/storage if enabled; resize volumes proactively.

Rallly on Klutch.sh delivers reproducible Docker builds, managed secrets, and optional storage—without extra YAML or CI steps. Configure ports, env vars, and storage, then launch your scheduling app.