fix: Bootstrap database seeds and styles in Docker development - #238
Open
mvanhorn wants to merge 1 commit into
Open
fix: Bootstrap database seeds and styles in Docker development#238mvanhorn wants to merge 1 commit into
mvanhorn wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The development container currently starts with
mix ecto.migrate, which creates the schema but never runspriv/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.setuprather than migration-only initialization, sopriv/repo/seeds.exscan 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.serverahead of database or asset bootstrap work.Summary
Update
Dockerfile.devso its entrypoint uses the existingmix ecto.setupalias 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 configuredtailwind default,tailwind admin, andsass defaulttasks before startingmix phx.server; the existing Phoenix watchers remain responsible for subsequent live rebuilds. Add a focused ExUnit contract test that readsDockerfile.devand verifies the required bootstrap commands are present and ordered before the server command, without introducing a production helper solely for testing.Fixes #230