fix(docker): single container (caddy+node), ESM adapters fix blank page
Docker: moved all docker files to docker/ tree (was conflated with upstream Dockerfile at root + server/Dockerfile). Single container now: caddy (front, serves static + proxies /api /ws) + node backend (internal :4001). Node never exposed. entrypoint.sh runs both. Compose: one service. Blank page root cause: storage adapters had inconsistent module systems. firebase.js = ESM (export). ws.js + memory.js = CJS (module.exports). CRA prod build = ESM strict -> CJS runtime crash, blank root. Dev mode lenient, masked bug. First ws prod build (docker) = first exposure. Never dev/prod split intended; just inconsistency from M2 era. Fix: all adapters ESM. ws.js lazy-loads 'ws' pkg via dynamic import() (Node/jest only; browser uses global WebSocket). index.js static imports. server jest: added babel.config.js (preset-env, node target) to transform ESM for jest. Test: src/tests/StorageEsm.test.js — 4 tests grep all adapters for module.exports / require(). Regression guard catches CJS leak. Verified: docker page renders (root 4534 chars, UI visible). server 24 green, shared 90 green, FE ESM 4 green.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# Ignore Git directory
|
||||
.git
|
||||
.gitignore
|
||||
|
||||
# Ignore Node.js modules (they will be installed in the Docker image)
|
||||
node_modules
|
||||
**/node_modules
|
||||
|
||||
# Ignore build output (it will be generated in the Docker image)
|
||||
build
|
||||
dist
|
||||
|
||||
# Ignore Docker files themselves (Caddyfile MUST stay in context for frontend build)
|
||||
Dockerfile
|
||||
Dockerfile.ws
|
||||
.dockerignore
|
||||
docker-compose.yml
|
||||
|
||||
# Ignore any local environment files if you have them
|
||||
.env
|
||||
.env.local
|
||||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
# Ignore IDE and OS-specific files
|
||||
.vscode/
|
||||
.idea
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
Thumbs.db
|
||||
.DS_Store
|
||||
|
||||
# Ignore local sqlite data + scratch diagnostics (never bake into image)
|
||||
data/
|
||||
scratch/
|
||||
tmp/
|
||||
Reference in New Issue
Block a user