You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(checks): on-demand log fetch with React Query and CL-scoped state
Fetch logs only for the selected build (SSE while building), replace manual
batch fetch with React Query caching, cap CachedLogPanel mounts with LRU,
and split index.tsx into useBuildSelection/useLogCache hooks. Scope buildId
and logs to CL via atomFamily, sync ?tab=check&build= URL, remember last
build per task, and add retry on log fetch errors.
Copy file name to clipboardExpand all lines: docker/README.md
+66-9Lines changed: 66 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,8 +7,8 @@
7
7
-[Demo Walk-Through](#demo-walk-through)
8
8
-[Service Endpoints](#service-endpoints)
9
9
-[FAQ](#faq)
10
-
-[Stopping & Cleanup](#stopping--cleanup)
11
-
-[Log Streaming](#log-streaming)
10
+
-[Stopping and Cleanup](#stopping-and-cleanup)
11
+
-[View logs](#view-logs)
12
12
-[Architecture Overview](#architecture-overview)
13
13
14
14
---
@@ -90,10 +90,23 @@ The main configurable environment variables include:
90
90
91
91
-**Service Images**:
92
92
-`MEGA_ENGINE_IMAGE`: Mega backend image (default: `public.ecr.aws/m8q5m4u3/mega/mono-engine:latest`)
93
-
-`MEGA_UI_IMAGE`: Mega UI image (default: `public.ecr.aws/m8q5m4u3/mega/mega-ui:demo-latest`)
93
+
-`MEGA_UI_IMAGE`: Mega UI unified image (default: `public.ecr.aws/m8q5m4u3/mega/mega-ui:latest`)
94
94
-`CAMPSITE_API_IMAGE`: Campsite API image (default: `public.ecr.aws/m8q5m4u3/mega/campsite-api:latest`)
95
+
-`CAMPSITE_HOST_PORT`: Host port for Campsite API (default: `18080`, maps to container port `8080`; avoids conflict with local tools such as Cursor on `8080`)
95
96
-`CAMPSITE_RUN_MIGRATIONS`: Whether to run database migrations when the container starts; `1` (default) to run, can be changed to `0` after the first successful migration to skip and speed up subsequent starts.
96
97
98
+
-**Mega UI Runtime URLs** (injected at container start; must be browser-reachable):
99
+
-`NEXT_PUBLIC_API_URL`: Campsite API for the **browser** (default: `http://api.gitmono.local:18080`)
100
+
-`NEXT_PUBLIC_INTERNAL_API_URL`: Campsite API for **Next.js SSR inside the mega_ui container** (default: `http://api.gitmono.local:8080` — Docker network alias + container port `8080`, not host port `18080`)
101
+
-`NEXT_PUBLIC_MONO_API_URL`: Mega / mono API (default: `http://git.gitmono.local:8000`)
102
+
-`NEXT_PUBLIC_ORION_API_URL`: Orion Server API (default: `http://orion.gitmono.local:8004`)
-`NEXT_PUBLIC_WEB_URL`: Web UI origin (default: `http://app.gitmono.local`)
105
+
-`NEXT_PUBLIC_SYNC_URL`: Real-time sync WebSocket URL (optional; leave empty if not used)
106
+
-`NEXT_PUBLIC_CRATES_PRO_URL`: Crates Pro API URL (optional; leave empty if not used)
107
+
108
+
The UI image is **environment-agnostic**: it is built once with placeholder URLs and `docker-entrypoint.sh` rewrites them from the variables above when `mega_ui` starts. You no longer need per-environment image tags such as `demo-latest`.
- Finally, start `mega_ui`, which injects `NEXT_PUBLIC_*` URLs at container start and serves the web UI on port 80
142
+
143
+
On first `mega_ui` start you should see log lines such as `[entrypoint] injecting runtime environment` followed by `NEXT_PUBLIC_* applied` — that confirms the unified image picked up your demo URLs.
122
144
123
145
### 4. Check service status
124
146
@@ -224,7 +246,7 @@ Log in with the following credentials:
224
246
|**Mega UI**|<http://app.gitmono.local>| Web Frontend UI |
225
247
|**Mega API**|<http://api.gitmono.local:8000>| Mega backend API |
226
248
|**Orion Server**|<http://orion.gitmono.local:8004>| Orion build server API |
227
-
|**Campsite API**|<http://api.gitmono.local:8080>| Campsite OAuth/SSO API |
249
+
|**Campsite API**|<http://api.gitmono.local:18080>| Campsite OAuth/SSO API |
228
250
|**PostgreSQL**| localhost:5432 | Database (used by Mega & Orion, mapped to host port 5432 in demo) |
229
251
|**MySQL**| localhost:3306 | Database (used by Campsite API, mapped to host port 3306 in demo) |
230
252
|**Redis**| localhost:6379 | Cache service (mapped to host port 6379 in demo) |
@@ -233,14 +255,32 @@ Log in with the following credentials:
**Problem**: After opening <http://app.gitmono.local>, API calls fail or target placeholder hostnames such as `rt-api.placeholder.local`.
269
+
270
+
**Cause**: The unified UI image did not receive `NEXT_PUBLIC_*` values at container start (older image without `docker-entrypoint.sh`, or missing environment block).
271
+
272
+
**Solution**:
273
+
274
+
1. Ensure `mega_ui` uses `public.ecr.aws/m8q5m4u3/mega/mega-ui:latest` (or a locally built unified image).
275
+
2. Confirm `docker/demo/.env` includes the `NEXT_PUBLIC_*` block from `.env.example`, or rely on the defaults in `docker-compose.demo.yml`.
You should see `NEXT_PUBLIC_* applied` for each configured variable.
283
+
244
284
### Port Conflict
245
285
246
286
**Issue**: Docker reports the port is already allocated
@@ -526,11 +566,28 @@ The demo environment includes the following services:
526
566
527
567
-**Application services**:
528
568
-`mega`: Mega backend (Rust)
529
-
-`mega_ui`: Mega Web UI (Next.js)
569
+
-`mega_ui`: Mega Web UI (Next.js, unified image with runtime `NEXT_PUBLIC_*` injection)
530
570
-`orion_server`: Orion build server (Rust)
531
-
-`orion_build_client`: Orion build client (based on the orion-client image)
532
571
-`campsite_api`: Campsite API (Ruby/Rails, built locally by default; if you have the encrypted development credentials configured you can pull the pre-built image directly via `CAMPSITE_API_IMAGE=public.ecr.aws/m8q5m4u3/mega/campsite-api:latest`)
533
572
573
+
### Mega UI: unified image + runtime configuration
574
+
575
+
Previously each environment shipped its own UI image tag (`demo-latest`, `gitmono-latest`, etc.) with URLs baked in at build time. The current flow uses **one**`mega-ui:latest` image for every environment:
576
+
577
+
1.**Build** (`moon/apps/web/Dockerfile`): compile with placeholder URLs from `moon/apps/web/.env.runtime`.
578
+
2.**Start** (`moon/apps/web/docker-entrypoint.sh`): replace placeholders in the compiled assets with `NEXT_PUBLIC_*` values from the container environment, then run `node server.js`.
579
+
3.**Configure locally**: set the `NEXT_PUBLIC_*` block in `docker/demo/.env` (see `.env.example`). Defaults in `docker-compose.demo.yml` already target the `gitmono.local` demo hostnames.
580
+
581
+
To build the UI image locally instead of pulling from ECR:
0 commit comments