It sat in backend/ while Compose reads .env from the repository root, so the "cp .env.example .env" in the compose header pointed at nothing. It also documented four settings that Compose never forwarded to the container: ALLOWED_ORIGINS and the three version-retention knobs would have been set in .env and silently done nothing. They are passed through now, unset meaning the server's own defaults. Checked both directions: every variable Compose reads is documented, and nothing documented is ignored. Dropped PORT from the example — the bundled nginx proxies to 4000 by name, so changing it could only break that. Added the data-directory and uid/gid settings, which were read but undocumented. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
82 lines
2.8 KiB
YAML
82 lines
2.8 KiB
YAML
# ─────────────────────────────────────────────
|
|
# InkNote — lokales Test-Setup (baut aus dem Quellcode)
|
|
#
|
|
# Prod-nah (nginx + gebautes Bundle) auf :3000
|
|
# docker compose -f docker-compose.dev.yml up -d --build
|
|
#
|
|
# Mit Hot-Reload-Dev-Server auf :5173 zusätzlich
|
|
# docker compose -f docker-compose.dev.yml --profile dev up -d --build
|
|
#
|
|
# docker compose -f docker-compose.dev.yml logs -f
|
|
# docker compose -f docker-compose.dev.yml down
|
|
#
|
|
# Secrets kommen aus .env (nicht committen!)
|
|
# Daten liegen unter ${INKNOTE_DATA_DIR:-./data} auf dem Host.
|
|
# ─────────────────────────────────────────────
|
|
|
|
services:
|
|
inknote-server:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
container_name: inknote-server-dev
|
|
restart: unless-stopped
|
|
environment:
|
|
- PORT=4000
|
|
- JWT_SECRET=${JWT_SECRET}
|
|
- ENCRYPTION_KEY=${ENCRYPTION_KEY}
|
|
# Only used when the database has no users at all: creates the first admin.
|
|
- INKNOTE_ADMIN_USER=${INKNOTE_ADMIN_USER:-}
|
|
- INKNOTE_ADMIN_PASSWORD=${INKNOTE_ADMIN_PASSWORD:-}
|
|
- NODE_ENV=development
|
|
# Optional tuning; unset means the server's own defaults apply.
|
|
- ALLOWED_ORIGINS=${ALLOWED_ORIGINS:-}
|
|
- MAX_VERSIONS_PER_NOTE=${MAX_VERSIONS_PER_NOTE:-}
|
|
- VERSION_RETENTION_DAYS=${VERSION_RETENTION_DAYS:-}
|
|
- VERSION_COALESCE_MINUTES=${VERSION_COALESCE_MINUTES:-}
|
|
# Bind mounts, not named volumes: the data sits in a plain directory on the
|
|
# Docker host where the host's own backup picks it up.
|
|
user: "${INKNOTE_UID:-1000}:${INKNOTE_GID:-1000}"
|
|
volumes:
|
|
- ${INKNOTE_DATA_DIR:-./data}/db:/app/data
|
|
- ${INKNOTE_DATA_DIR:-./data}/uploads:/app/uploads
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://localhost:4000/api/health"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 10s
|
|
|
|
inknote-web:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: dockerfile
|
|
container_name: inknote-web-dev
|
|
restart: unless-stopped
|
|
ports:
|
|
- "3000:80"
|
|
depends_on:
|
|
inknote-server:
|
|
condition: service_healthy
|
|
|
|
# Vite mit Hot-Reload — nur mit "--profile dev"
|
|
inknote-vite:
|
|
image: node:20-alpine
|
|
container_name: inknote-vite-dev
|
|
profiles: ["dev"]
|
|
working_dir: /app
|
|
command: sh -c "npm install && npm run dev"
|
|
environment:
|
|
- VITE_API_TARGET=http://inknote-server:4000
|
|
volumes:
|
|
- ./frontend:/app
|
|
- inknote-dev-node-modules:/app/node_modules
|
|
ports:
|
|
- "5173:5173"
|
|
depends_on:
|
|
inknote-server:
|
|
condition: service_healthy
|
|
|
|
volumes:
|
|
inknote-dev-node-modules:
|