Files
cms-plugins/app/astro.config.mjs
T
Oleks 67b07634ae initial scaffold: emdash catalog, helm chart, woodpecker pipeline, ddev
- app/: Emdash scaffold (Astro 6, node target) with cmses/plugins/pages collections
- app/seed/seed.json: WordPress→Emdash parity for kotkanagrilli.fi (~30 entries)
- Dockerfile + docker/entrypoint.sh: multi-stage build, single PVC at /app/state
- deploy/helm/: chart mirroring emdash-kotkanagrilli (single-replica, sqlite, kotkan)
- deploy/fleet-overlay/: HelmRelease/source/image-automation templates for
  anton-helm-workloads (staging + production)
- .woodpecker/container.yaml: arm64 build, three OCI tags per push
  (immutable 0.1.<pipeline> + floating <branch> + <branch>-latest)
- .ddev/: local dev with nginx proxy to emdash on :4321
- README/DEPLOYMENT/ARCHITECTURE/CLAUDE: docs covering the three-repo
  pipeline (cms-plugins + anton-helm-workloads + Gitea OCI registry)
2026-05-20 11:19:00 +03:00

44 lines
1.2 KiB
JavaScript

import node from "@astrojs/node";
import react from "@astrojs/react";
import { defineConfig, memoryCache } from "astro/config";
import emdash, { local } from "emdash/astro";
import { sqlite } from "emdash/db";
// Persistent state directory. Defaults to the working directory for dev/DDEV
// (so data.db + uploads/ stay where you'd expect them). The k8s deploy sets
// STATE_DIR=/app/state and mounts a PVC there so SQLite + uploads survive
// pod replacement.
const stateDir = process.env.STATE_DIR ?? ".";
export default defineConfig({
output: "server",
adapter: node({ mode: "standalone" }),
trailingSlash: "ignore",
server: { host: true, port: 4321 },
vite: {
server: {
// Dev runs behind DDEV's nginx (https://cms-plugins.ddev.site/).
// Vite's host check must allow the public hostname.
allowedHosts: ["cms-plugins.ddev.site", ".ddev.site"],
},
},
image: {
layout: "constrained",
responsiveStyles: true,
},
integrations: [
react(),
emdash({
database: sqlite({ url: `file:${stateDir}/data.db` }),
storage: local({
directory: `${stateDir}/uploads`,
baseUrl: "/_emdash/api/media/file",
}),
}),
],
experimental: {
cache: { provider: memoryCache() },
},
devToolbar: { enabled: false },
});