Skip to content

fix: Bootstrap database seeds and styles in Docker development - #238

Open
mvanhorn wants to merge 1 commit into
ClaperCo:devfrom
mvanhorn:fix/230-docker-dev-bootstrap
Open

fix: Bootstrap database seeds and styles in Docker development#238
mvanhorn wants to merge 1 commit into
ClaperCo:devfrom
mvanhorn:fix/230-docker-dev-bootstrap

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Aug 8, 2026

Copy link
Copy Markdown

The development container currently starts with mix ecto.migrate, which creates the schema but never runs priv/repo/seeds.exs, leaving a fresh environment without the documented default admin account. Its entrypoint also starts Phoenix immediately after installing npm dependencies, without first producing the default Tailwind, admin Tailwind, and Sass outputs needed for a usable first page load. The repository already defines the required seed and asset tasks, and a contributor confirmed the missing admin Tailwind target in the issue thread. The fix is limited to making the existing Docker development startup sequence invoke those established tasks.

Testing

A fresh development startup contract uses mix ecto.setup rather than migration-only initialization, so priv/repo/seeds.exs can create the default admin account.
The entrypoint builds default Tailwind, admin Tailwind, and Sass assets after npm dependencies are installed and before Phoenix starts.
The regression test rejects a startup sequence that omits any required style target or moves mix phx.server ahead of database or asset bootstrap work.

Summary

Update Dockerfile.dev so its entrypoint uses the existing mix ecto.setup alias in place of migration-only startup, preserving repeat startup behavior while ensuring roles, the default admin, and settings are seeded on a fresh database. After npm installation, run the configured tailwind default, tailwind admin, and sass default tasks before starting mix phx.server; the existing Phoenix watchers remain responsible for subsequent live rebuilds. Add a focused ExUnit contract test that reads Dockerfile.dev and verifies the required bootstrap commands are present and ordered before the server command, without introducing a production helper solely for testing.

Fixes #230

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.

[AI GENERATED ISSUE] docker-compose.dev.yml does not set up dev environment correctly: no CSS, no default admin account, broken DX

1 participant