-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy pathcompose.yaml
More file actions
81 lines (77 loc) · 2.92 KB
/
Copy pathcompose.yaml
File metadata and controls
81 lines (77 loc) · 2.92 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# docker compose runs website + docs + blog + ui-website as four services
# from a single image. Local parity with Railway deployment (same Dockerfile).
#
# docker compose up --build
# website → http://localhost:15001
# docs → http://localhost:15002
# blog → http://localhost:15004
# ui-website → http://localhost:15003 (registry host + @webjsdev/ui docs)
#
# Readiness gate: the image carries a single PORT-driven HEALTHCHECK (it probes
# /__webjs/ready, see Dockerfile), so each service only sets PORT and compose
# inherits the gate. No per-service healthcheck block is duplicated here.
services:
website:
image: webjs
build: .
working_dir: /app/website
# @webjsdev/cli installed in the root node_modules/.bin by npm workspaces;
# invoke its binary directly rather than via `webjs`. Run it under `bun` so
# `startServer` selects the native Bun.serve listener shell; the image carries
# the Bun binary (see Dockerfile). The server reads PORT (set below) with no
# --port flag, so the image HEALTHCHECK probes the same port.
command: ["bun", "/app/node_modules/@webjsdev/cli/bin/webjs.js", "start"]
ports:
- "15001:5001"
environment:
PORT: "5001"
DOCS_URL: ${DOCS_URL:-http://localhost:15002}
EXAMPLE_BLOG_URL: ${EXAMPLE_BLOG_URL:-http://localhost:15004}
UI_URL: ${UI_URL:-http://localhost:15003}
docs:
image: webjs
build: .
working_dir: /app/docs
command: ["bun", "/app/node_modules/@webjsdev/cli/bin/webjs.js", "start"]
ports:
- "15002:5002"
environment:
PORT: "5002"
blog:
image: webjs
build: .
working_dir: /app/examples/blog
# Apply Drizzle migrations, then serve on Bun. `webjs db migrate` is the
# drizzle-kit path (npx-free since cli #570, proven under Bun), idempotent so
# a second boot on an already-migrated DB is a quick no-op.
command:
- sh
- -c
- |
bun /app/node_modules/@webjsdev/cli/bin/webjs.js db migrate && \
bun /app/node_modules/@webjsdev/cli/bin/webjs.js start
ports:
- "15004:5004"
environment:
PORT: "5004"
DATABASE_URL: file:/data/dev.db
AUTH_SECRET: ${AUTH_SECRET:-change-me-at-least-32-characters-long!}
SESSION_SECRET: ${SESSION_SECRET:-change-me-at-least-32-characters-long!}
volumes:
- blog-data:/data
ui-website:
image: webjs
build: .
working_dir: /app/packages/ui/packages/website
# Registry host for @webjsdev/ui:
# GET /r/<name>.json single registry item (CLI fetches from here)
# GET /r/index.json flat list of all items
# GET /docs/components/<name> per-component docs page
# The registry JSON is built at image time (see Dockerfile RUN step).
command: ["bun", "/app/node_modules/@webjsdev/cli/bin/webjs.js", "start"]
ports:
- "15003:5003"
environment:
PORT: "5003"
volumes:
blog-data: