A1: foundation scaffold (Next.js 15, shadcn/Radix, Drizzle+Postgres, Vitest, Docker)
- Next.js 15 + TS strict + Tailwind 4 + ESLint 9 - shadcn/ui initialized (Radix, CSS variables); cn() util - Drizzle + postgres driver + Zod; db client + schema placeholder (A2) - Vitest with passing cn() test; GitHub Actions CI - Portable container stack: multi-stage non-root Dockerfile, docker-compose (app + Postgres on host 5433) - Verified: typecheck, lint, test (3), build, docker build, HTTP 200 on :3000 - Records the 5 pre-build decisions (email-only launch, SMS deferred)
This commit is contained in:
@@ -0,0 +1,63 @@
|
||||
# Media Team Hub — portable stack (app + Postgres).
|
||||
#
|
||||
# docker compose up --build app db # run the app
|
||||
# docker compose --profile tools run --rm migrate # run migrations + seed
|
||||
#
|
||||
# The app is standard HTTP on :3000 — put it behind your reverse proxy.
|
||||
# Host ports are chosen to avoid everything already running on this host
|
||||
# (see the port audit): app=3000, postgres published on 5433 (local 5432 is taken).
|
||||
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
environment:
|
||||
NODE_ENV: production
|
||||
DATABASE_URL: postgres://media:media@db:5432/media
|
||||
NEXTAUTH_URL: http://localhost:3000
|
||||
NEXTAUTH_SECRET: ${NEXTAUTH_SECRET:-dev-only-secret-change-me}
|
||||
POSTMARK_FROM: media@localhost
|
||||
APP_ORIGIN: http://localhost:3000
|
||||
CHURCH_TIMEZONE: America/New_York
|
||||
ports:
|
||||
- "3000:3000"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
restart: unless-stopped
|
||||
|
||||
db:
|
||||
image: postgres:16-alpine
|
||||
environment:
|
||||
POSTGRES_USER: media
|
||||
POSTGRES_PASSWORD: media
|
||||
POSTGRES_DB: media
|
||||
# Host 5433 -> container 5432 (local postgres already holds 5432).
|
||||
ports:
|
||||
- "5433:5432"
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "pg_isready -U media"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
restart: unless-stopped
|
||||
|
||||
# One-shot migrations + seed. Run on demand:
|
||||
# docker compose --profile tools run --rm migrate
|
||||
migrate:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
command: ["sh", "-c", "pnpm db:generate && pnpm db:migrate && pnpm db:seed"]
|
||||
environment:
|
||||
DATABASE_URL: postgres://media:media@db:5432/media
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
profiles: ["tools"]
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
Reference in New Issue
Block a user