Docker dev modernization#847
Conversation
| "author": "", | ||
| "scripts": { | ||
| "postinstall": "patch-package && ./node_modules/bower/bin/bower install", | ||
| "postinstall": "patch-package && ./node_modules/bower/bin/bower --allow-root install", |
There was a problem hiding this comment.
--allow-root is... concerning. Why?
compwron
left a comment
There was a problem hiding this comment.
CI is mad on frontend versions - thoughts?
1s
Run npm install
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for flaredown@0.0.0: wanted: {"bower":"1.x","node":"14.x","npm":"6.x"} (current: {"node":"20.20.2","npm":"6.14.18"})
npm ERR! notsup Not compatible with your version of node/npm: flaredown@0.0.0
npm ERR! notsup Not compatible with your version of node/npm: flaredown@0.0.0
npm ERR! notsup Required: {"bower":"1.x","node":"14.x","npm":"6.x"}
npm ERR! notsup Actual: {"npm":"6.14.18","node":"20.20.2"}
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2026-07-12T06_51_39_229Z-debug.log
Error: Process completed with exit code 1.
There was a problem hiding this comment.
Pull request overview
This PR modernizes Flaredown’s Docker-based development workflow (especially for modern macOS/Apple Silicon) by fixing problematic port publishing, tightening host bindings, and updating the frontend test runner away from PhantomJS toward headless Chrome/Chromium.
Changes:
- Updated Docker Compose dev port publishing (bind to
127.0.0.1) and moved Ember live reload off65535to4301. - Switched frontend tests from PhantomJS to headless Chrome/Chromium (Docker + Testem config + CI env wiring).
- Added frontend container dependency-volume + entrypoint logic to keep container-installed dependencies from being clobbered by bind mounts.
Reviewed changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates contributor docs to position Docker as an option and document new Docker dev workflow. |
| Makefile | Changes make seed to run the Docker app-setup tooling flow. |
| docker-compose.yml | Binds dev ports to localhost, changes live reload port, adds named volumes, adds app-setup tooling service. |
| frontend/Dockerfile | Removes forced linux/amd64, installs Chromium, sets up entrypoint-driven dependency install. |
| frontend/bin/docker-entrypoint | Adds checksum-based dependency refresh so bind mounts don’t break node/bower installs. |
| frontend/testem.js | Runs tests in Chrome (CI/dev) with explicit Chrome path + args. |
| frontend/README.md | Removes PhantomJS prerequisite from frontend docs. |
| frontend/package.json | Removes PhantomJS dependency and adjusts Bower install to allow root in containers. |
| frontend/package-lock.json | Removes PhantomJS-related dependency tree entries. |
| backend/lib/tasks/app.rake | Refreshes schema cache/column info after migrations; improves interactive prompt handling. |
| .github/workflows/frontend.yml | Updates frontend CI to use Chrome and pins npm version. |
| .gitignore | Ignores docs/superpowers/. |
Files not reviewed (1)
- frontend/package-lock.json: Generated file
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| cp backend/env-example frontend/.env | ||
| ``` | ||
|
|
||
| Set `FACEBOOK_APP_ID` in `frontend/.env` if you want to use Facebook login locally. |
| @@ -20,7 +20,7 @@ console: ## Open a rails console | |||
| docker compose --profile dev run --rm backend rails c | |||
|
|
|||
| seed: ## Seed your database | |||
| with: | ||
| node-version: ${{ matrix.node_version }} | ||
| - run: npm install -g npm@7.0.0 | ||
| - run: npm install -g npm@6.14.18 |
| env: | ||
| CHROME_BIN: google-chrome | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 14 | ||
| cache: npm | ||
| cache-dependency-path: frontend/package-lock.json | ||
| - run: npm install -g npm@7.0.0 | ||
| - run: npm install -g npm@6.14.18 |
|
Concern: the frontend image is no longer self-contained
Not necessarily a blocker — it's a reasonable way to keep bind-mounted source from clobbering container-installed deps — but it's a meaningful shift in how the image behaves. Worth a short note in the README (e.g. "run |
|
Addressed the latest review comments in separate commits:
|
a647da1 to
88baa6a
Compare
Summary
Resolve #826
This PR modernizes the Docker development setup so a new contributor can clone the repo and run Flaredown in Docker on modern Mac hardware, including Apple Silicon.
The original Docker startup issue was caused by the frontend live reload port binding to
65535. Docker Desktop could create the frontend container, but stalled before starting it because that host port falls into the system ephemeral port range on macOS/Linux. The fix is to move Ember live reload to4301and publish only localhost-bound development ports.During troubleshooting, I also replaced PhantomJS with headless Chrome for frontend tests. That change turned out not to be required for the Docker startup issue itself, but I am proposing we keep it because PhantomJS has been archived since 2018 and this aligns with the broader priority of modernizing Flaredown. The frontend image was forced to linux/amd64, likely to support PhantomJS. Removing PhantomJS lets the frontend image run natively on Apple Silicon and removes a deprecated browser dependency, so it is not the direct fix for the port hang but is part of making Docker development work naturally on modern Macs.The frontend test suite now runs successfully under Chrome in Docker.
What Changed
linux/amd64frontend Docker platform so Docker can run natively on modern Mac chips.CHROME_BIN.65535to4301.127.0.0.1instead of all host interfaces.package.json,package-lock.json, Bower config, npm config, or patches change.app:setupso schema cache is refreshed after migrations before loading seeds.Verification
docker compose config --quietdocker compose --profile tools run --rm app-setupdocker compose --profile dev up -d --buildhttp://127.0.0.1:4300http://127.0.0.1:30004301listeningdocker compose --profile dev run --rm frontend npm run test120.0452 tests452 pass0 fail