4ac34ca943
Deploy to Dev / Deploy & Smoke Test (push) Successful in 23s
Lets the photographer edit config/site.json from /dashboard instead of SSHing in and hand-editing the file. Two tiers: - Quick-edit form for the fields actually touched day to day (site title/tagline/hero, photographer bio, contact/social, Venmo username, session pricing, theme colors) - Raw JSON textarea for everything else (portfolio categories, locations, session types, Immich settings) - the form's fields are a subset of this, not a separate source of truth Backend: GET/PUT /api/admin/config, gated by the existing requireAdmin middleware (OIDC admin session or legacy ADMIN_SECRET). PUT validates the body is an object with the required top-level sections, writes atomically (temp file + rename), and keeps one prior version as site.json.bak before overwriting. Required a docker-compose.yml change: the api service had no volume mount for config/ at all before this (only portfolio/nginx did, and read-only) - added a read-write mount so the API can actually write the file the live site reads.
58 lines
1.5 KiB
YAML
58 lines
1.5 KiB
YAML
version: '3.8'
|
|
|
|
services:
|
|
portfolio:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: lisilou-portfolio-web:local
|
|
container_name: lisilou-portfolio
|
|
restart: unless-stopped
|
|
ports:
|
|
- "8080:80"
|
|
volumes:
|
|
# Mount config for easy updates without rebuilding
|
|
- ./config:/usr/share/nginx/html/config:ro
|
|
# Mount images for easy updates
|
|
- ./public/images:/usr/share/nginx/html/images:ro
|
|
environment:
|
|
- TZ=America/Denver
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 10s
|
|
networks:
|
|
- web
|
|
|
|
api:
|
|
build:
|
|
context: ./api
|
|
dockerfile: Dockerfile
|
|
image: lisilou-portfolio-api:local
|
|
container_name: lisilou-api
|
|
restart: unless-stopped
|
|
env_file:
|
|
- ./api/.env
|
|
volumes:
|
|
- ./api/data:/app/data
|
|
- ./api/signed-contracts:/app/signed-contracts
|
|
- ./api/contracts:/app/contracts:ro
|
|
# Read-write: the admin config screen (issue #14) edits site.json here.
|
|
# Shares the same host directory the portfolio/nginx service mounts
|
|
# read-only, so writes show up on the live site (subject to its 5-min cache).
|
|
- ./config:/app/config
|
|
networks:
|
|
- web
|
|
healthcheck:
|
|
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3001/api/health"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|
|
start_period: 15s
|
|
|
|
networks:
|
|
web:
|
|
external: true
|