Skip to content

Commit 93da6ec

Browse files
authored
build(deploy): add nixpacks configs for docs, playground, and storybook apps (#284)
1 parent 0a11e31 commit 93da6ec

3 files changed

Lines changed: 87 additions & 0 deletions

File tree

apps/docs/nixpacks.toml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Nixpacks build config for @styleframe/docs (Nuxt, node-server output).
2+
#
3+
# Build from the monorepo root so pnpm can resolve the workspace and the single
4+
# root lockfile. Point the platform at this file with NIXPACKS_CONFIG_FILE:
5+
# Dokploy/Railway: Build Type "Nixpacks", root / context ".",
6+
# env NIXPACKS_CONFIG_FILE=apps/docs/nixpacks.toml, container port 3000.
7+
#
8+
# Node + pnpm (pinned via the root packageManager field) are provided
9+
# automatically by the Node provider through Corepack.
10+
11+
[phases.install]
12+
cmds = [
13+
'pnpm install --frozen-lockfile --filter @styleframe/docs --filter @styleframe/app-shared',
14+
]
15+
16+
[phases.build]
17+
dependsOn = ['install']
18+
# The prerenderer needs more heap than node's default in memory-limited builders.
19+
cmds = ['NODE_OPTIONS=--max-old-space-size=4096 pnpm --filter @styleframe/docs run build']
20+
21+
# Public runtime config is baked into prerendered pages at build time, so these
22+
# must be present during the build, not only at runtime.
23+
[variables]
24+
NUXT_TELEMETRY_DISABLED = '1'
25+
NUXT_PUBLIC_BASE_URL = 'https://www.styleframe.dev'
26+
NUXT_PUBLIC_POSTHOG_KEY = 'phc_Vu3wqbMj8M5iWzvEulIXlK5U0A3hqkb5rlVM1DLtZsb'
27+
NUXT_PUBLIC_POSTHOG_HOST = 'https://eu.i.posthog.com'
28+
NUXT_PUBLIC_POSTHOG_DEFAULTS = '2025-05-24'
29+
HOST = '0.0.0.0'
30+
PORT = '3000'
31+
32+
# Nuxt Content creates its SQLite database inside .output/server at runtime.
33+
[start]
34+
cmd = 'node apps/docs/.output/server/index.mjs'

apps/playground/nixpacks.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Nixpacks build config for @styleframe/playground (Vite static build, served by Caddy).
2+
#
3+
# Build from the monorepo root so pnpm can resolve the workspace and the single
4+
# root lockfile, and turbo can build the @styleframe/* packages the playground imports.
5+
# Point the platform at this file with NIXPACKS_CONFIG_FILE:
6+
# Dokploy/Railway: Build Type "Nixpacks", root / context ".",
7+
# env NIXPACKS_CONFIG_FILE=apps/playground/nixpacks.toml, container port 80.
8+
#
9+
# Node + pnpm (pinned via the root packageManager field) are provided
10+
# automatically by the Node provider through Corepack.
11+
12+
# Add Caddy alongside the auto-detected Node + pnpm toolchain to serve the build.
13+
[phases.setup]
14+
nixPkgs = ['...', 'caddy']
15+
16+
[phases.install]
17+
cmds = ['pnpm install --frozen-lockfile']
18+
19+
[phases.build]
20+
dependsOn = ['install']
21+
# turbo builds the workspace deps (core, runtime, scanner, theme, transpiler) first.
22+
cmds = ['pnpm turbo run build --filter=@styleframe/playground']
23+
24+
[start]
25+
cmd = 'caddy file-server --root apps/playground/dist --listen :80'

apps/storybook/nixpacks.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Nixpacks build config for @styleframe/storybook (static build, served by Caddy).
2+
#
3+
# Build from the monorepo root so pnpm can resolve the workspace and the single
4+
# root lockfile, and turbo can build the @styleframe/* packages Storybook imports.
5+
# Point the platform at this file with NIXPACKS_CONFIG_FILE:
6+
# Dokploy/Railway: Build Type "Nixpacks", root / context ".",
7+
# env NIXPACKS_CONFIG_FILE=apps/storybook/nixpacks.toml, container port 80.
8+
#
9+
# Node + pnpm (pinned via the root packageManager field) are provided
10+
# automatically by the Node provider through Corepack.
11+
12+
# Add Caddy alongside the auto-detected Node + pnpm toolchain to serve the build.
13+
[phases.setup]
14+
nixPkgs = ['...', 'caddy']
15+
16+
[phases.install]
17+
cmds = ['pnpm install --frozen-lockfile']
18+
19+
[phases.build]
20+
dependsOn = ['install']
21+
# turbo builds the workspace deps (core, plugin, runtime, theme) before Storybook.
22+
cmds = ['pnpm turbo run build --filter=@styleframe/storybook']
23+
24+
[variables]
25+
PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD = '1'
26+
27+
[start]
28+
cmd = 'caddy file-server --root apps/storybook/storybook-static --listen :80'

0 commit comments

Comments
 (0)