# Development container for the emdash app. Bind-mounts ../app from # the host and runs `npx emdash dev` so source edits hot-reload. The # production image is built separately from the root Dockerfile and # consumed by deploy/helm/ — DDEV is *not* a prod-parity smoke test. services: emdash: container_name: ddev-${DDEV_SITENAME}-emdash image: node:22-bookworm-slim working_dir: /app restart: "no" expose: - "4321" env_file: - ../app/.env environment: HOST: "0.0.0.0" PORT: "4321" NODE_ENV: "development" EMDASH_ALLOWED_ORIGINS: "https://cms-plugins.ddev.site" EMDASH_SITE_URL: "https://cms-plugins.ddev.site" volumes: - ../app:/app:cached # Anonymous-ish named volume for node_modules so the host's # (possibly empty / wrong-arch) directory doesn't shadow what # the container installs. - emdash-node-modules:/app/node_modules command: - sh - -c - | set -eu if [ ! -d node_modules ] || [ -z "$$(ls -A node_modules 2>/dev/null)" ]; then echo "[emdash] installing deps" apt-get update && apt-get install -y --no-install-recommends python3 make g++ ca-certificates >/dev/null npm install fi if [ ! -f data.db ]; then echo "[emdash] running emdash init" node_modules/.bin/emdash init fi exec npx emdash dev labels: com.ddev.site-name: ${DDEV_SITENAME} com.ddev.approot: $DDEV_APPROOT volumes: emdash-node-modules: