Add a simone dev service to docker-compose - #119
Merged
Merged
Conversation
Adds a `simone` service alongside `db` so `docker compose up` brings up a full local dev stack: Django runserver with live reload (source bind-mounted) wired to a MariaDB instance. - Bump db image from mariadb:10.1 to mariadb:12-noble to match production's docker-compose and reduce drift. This also happens to sidestep a bug in mysql-connector-python>=9.6.0 where Django's mysql sql_mode check crashes on a broken @cached_property/@staticmethod stack in DatabaseWrapper.display_name -- MariaDB 12's strict-by-default sql_mode never exercises that code path. - Create the simone db/user on first boot via MYSQL_DATABASE/ MYSQL_USER/MYSQL_PASSWORD. - Add a healthcheck using the image's healthcheck.sh --connect so the simone service doesn't race the DB's first-boot restart cycle. - New simone service: builds from the existing Dockerfile, bind-mounts the repo for live reload, runs migrate then runserver, and sets the env vars needed to boot in dev (dev-only DJANGO_SECRET_KEY, SIMONE_DB_* pointed at db, DJANGO_ALLOWED_HOSTS for localhost, plus the blank API-key vars already mocked by .git_hooks_pre-commit). - Drop the obsolete `version:` key.
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.
Summary
simoneservice todocker-compose.ymlalongside the existingdbservice, sodocker compose upbrings up a full local dev stack: Djangorunserverwith live reload (source bind-mounted) wired to a MariaDB instance.dbimage frommariadb:10.1tomariadb:12-nobleto match production's compose setup and reduce drift. This also happens to sidestep a bug inmysql-connector-python>=9.6.0(currently pinned at 9.7.0) where Django's mysqlsql_modecheck crashes on a broken@cached_property/@staticmethodstack inDatabaseWrapper.display_name— MariaDB 12's strict-by-defaultsql_modenever exercises that code path.MYSQL_DATABASE/MYSQL_USER/MYSQL_PASSWORDso thesimonedb/user get created on first boot, and a healthcheck using the image's built-inhealthcheck.sh --connectso thesimoneservice doesn't race the DB's first-boot restart cycle.simoneservice builds from the existingDockerfile, bind-mounts the repo (:zfor SELinux) for live reload, runsmigratethenrunserver, and sets the env vars needed to boot in dev (dev-onlyDJANGO_SECRET_KEY,SIMONE_DB_*pointed atdb,DJANGO_ALLOWED_HOSTSfor localhost, plus the blank API-key vars already mocked by.git_hooks_pre-commit).version:key (Compose warns it's ignored).Testing
Verified a full cold-start cycle locally:
docker compose up -d --buildfrom an empty volume bringsdbhealthy,simonerunsmigratecleanly and serves/adm/login/(200), and editing a source file on the host triggersrunserver's autoreloader inside the container.