Skip to content

Docker dev modernization#847

Open
CoryMCodes wants to merge 10 commits into
rubyforgood:masterfrom
CoryMCodes:docker-dev-modernization
Open

Docker dev modernization#847
CoryMCodes wants to merge 10 commits into
rubyforgood:masterfrom
CoryMCodes:docker-dev-modernization

Conversation

@CoryMCodes

Copy link
Copy Markdown

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 to 4301 and 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

  • Removed the forced linux/amd64 frontend Docker platform so Docker can run natively on modern Mac chips.
  • Replaced PhantomJS frontend test runner with headless Chrome/Chromium.
  • Installed Chromium in the frontend Docker image and wired Testem to CHROME_BIN.
  • Moved Ember live reload from host port 65535 to 4301.
  • Bound development ports to 127.0.0.1 instead of all host interfaces.
  • Added named Docker volumes for frontend dependencies so bind-mounted source code does not overwrite container-installed dependencies.
  • Added frontend entrypoint logic to refresh dependencies when package.json, package-lock.json, Bower config, npm config, or patches change.
  • Made Docker database setup remain interactive and documented that it resets local Docker dev/test DBs.
  • Fixed app:setup so schema cache is refreshed after migrations before loading seeds.
  • Updated docs to present Docker as one supported development method, not necessarily the default.

Verification

  • docker compose config --quiet
  • docker compose --profile tools run --rm app-setup
  • docker compose --profile dev up -d --build
  • Frontend reachable at http://127.0.0.1:4300
  • Backend reachable at http://127.0.0.1:3000
  • Live reload port 4301 listening
  • docker compose --profile dev run --rm frontend npm run test
    • Chrome 120.0
    • 452 tests
    • 452 pass
    • 0 fail

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make a docker

2 participants