690 files changed
+12045
-33943
No files matched your search
@@ -0,0 +1,107 @@
|
||||
name: next-chair
|
||||
|
||||
# Local Docker Desktop deployment — production-style by default (real
|
||||
# migrations, no auto-seed), not a dev-mode source-mount setup. See the
|
||||
# README section this file is documented under for exact commands.
|
||||
#
|
||||
# Config source of truth: copy .env.local.example to .env.local and run
|
||||
# every command below with `--env-file .env.local` (see README) — that
|
||||
# one file drives both container environment variables (via each
|
||||
# service's `env_file:`) and the few values this compose file itself
|
||||
# needs (the host-port mappings below).
|
||||
|
||||
services:
|
||||
next-chair-mysql:
|
||||
image: mysql:8.0
|
||||
container_name: next-chair-mysql
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
- .env.local
|
||||
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_0900_ai_ci
|
||||
ports:
|
||||
- "${MYSQL_HOST_PORT:-3306}:3306"
|
||||
volumes:
|
||||
- next-chair-mysql-data:/var/lib/mysql
|
||||
healthcheck:
|
||||
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-change-me-too}"]
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 20
|
||||
start_period: 10s
|
||||
networks:
|
||||
- next-chair
|
||||
|
||||
next-chair:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: next-chair
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
next-chair-mysql:
|
||||
condition: service_healthy
|
||||
env_file:
|
||||
- .env.local
|
||||
ports:
|
||||
- "${APP_HOST_PORT:-3000}:3000"
|
||||
volumes:
|
||||
# Media Manager uploads — a dedicated volume, separate from
|
||||
# next-chair-mysql-data. Phase 10 moved the mount point from
|
||||
# /app/public/media to /app/storage/media (outside public/ — see
|
||||
# src/lib/media/media-storage.ts's header for why runtime uploads
|
||||
# can't live under public/ with this Next.js version) while
|
||||
# deliberately keeping the SAME volume name, so any file already
|
||||
# uploaded before this fix reappears at its new path instead of
|
||||
# being orphaned. Writable by the non-root nextchair user (the
|
||||
# Dockerfile pre-creates and chowns this directory before the
|
||||
# volume first attaches). Persists across `docker compose restart`
|
||||
# and a full image rebuild, since it's a named volume, not
|
||||
# container-local storage.
|
||||
- next-chair-media:/app/storage/media
|
||||
healthcheck:
|
||||
# No curl/wget in the node:22-alpine base image — a plain Node
|
||||
# request avoids adding a package just for this. See
|
||||
# src/app/api/health/route.ts: healthy as soon as the database is
|
||||
# reachable, even before installation completes.
|
||||
test:
|
||||
[
|
||||
"CMD",
|
||||
"node",
|
||||
"-e",
|
||||
"require('http').get('http://localhost:3000/api/health', r => process.exit(r.statusCode === 200 ? 0 : 1)).on('error', () => process.exit(1))",
|
||||
]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 20s
|
||||
networks:
|
||||
- next-chair
|
||||
|
||||
# Explicit, opt-in only — never runs as part of a normal `up` (see the
|
||||
# `profiles` key). Development/demo fixtures, not a production seed —
|
||||
# see prisma/seed.ts's own header and docs/phase-8-summary.md,
|
||||
# "Production installation versus development seed."
|
||||
next-chair-seed:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: Dockerfile
|
||||
container_name: next-chair-seed
|
||||
profiles: ["seed"]
|
||||
depends_on:
|
||||
next-chair-mysql:
|
||||
condition: service_healthy
|
||||
env_file:
|
||||
- .env.local
|
||||
entrypoint: ["npx", "tsx", "prisma/seed.ts"]
|
||||
networks:
|
||||
- next-chair
|
||||
|
||||
volumes:
|
||||
next-chair-mysql-data:
|
||||
name: next-chair-mysql-data
|
||||
next-chair-media:
|
||||
name: next-chair-media
|
||||
|
||||
networks:
|
||||
next-chair:
|
||||
name: next-chair
|
||||
Reference in new issue
Block a user