Skip to content

Repository files navigation

Guestbook — Postgres + web UI example

A minimal guestbook: an Express web UI backed by Postgres. One container, one database — the smallest realistic shape of a deployable web app. Useful as a test fixture for deploy-from-GitHub flows.

Layout

  • server.js — web UI + API, listens on $PORT (default 3000), reads DATABASE_URL
  • Dockerfile — production image (EXPOSE 3000)
  • docker-compose.yml — local dev stack (web + Postgres)
  • .env.example — the one required environment variable

The schema is created automatically on boot (CREATE TABLE IF NOT EXISTS), with retries in the background — the server starts serving immediately even if the database is still waking up. /healthz reports both states.

Run locally

docker compose up --build
# open http://localhost:3000

Or without Docker (needs a running Postgres):

npm install
DATABASE_URL=postgres://user:pass@localhost:5432/guestbook npm start

Deploy on InstaCloud

insta project create guestbook
insta services add postgres db
insta services add compute app
insta secrets bind DATABASE_URL postgres/db --to compute/app
insta deploy . --port 3000

Or point the console's Deploy from GitHub flow at this repo: it should detect exactly one service (this app, port 3000) and suggest DATABASE_URL; add a Postgres service and bind it, then deploy.

About

Example app: Postgres + web UI guestbook — deploy-from-GitHub test fixture

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages