feat(docker): add Docker Compose for local development with PostGIS#614
Open
NteinPrecious wants to merge 1 commit into
Open
feat(docker): add Docker Compose for local development with PostGIS#614NteinPrecious wants to merge 1 commit into
NteinPrecious 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.
Summary
Closes #91
Adds a root-level
docker-compose.ymlfor one-command local development, and aBackend/Dockerfile.devfor hot-reload development. Also fixes the existinginfrastructure/docker/setup which was using plain Postgres without PostGIS — a hard requirement for the app's geospatial queries.Changes
New files
docker-compose.yml(root — local dev entry point)postgis/postgis:16-3.4-alpineso PostGIS is available immediatelynpm run start:dev(hot reload via NestJS watch mode)DATABASE_HOST,DATABASE_PORT, etc.) match what the backend expects./Backend/.envoverride viaenv_fileBackend/Dockerfile.devnode:20-alpine) — installs all deps and starts in watch modebackend.DockerfileUpdated files
infrastructure/docker/postgres-init.sqlCREATE EXTENSION IF NOT EXISTS postgisandpostgis_topology— without these the app's PostGIS migrations andST_DWithinqueries fail on first bootinfrastructure/docker/docker-compose.ymlpostgres:16-alpine→postgis/postgis:16-3.4-alpineDATABASE_URL(not used by the backend) with the individualDATABASE_*env vars the app actually readsUsage
Test plan
docker compose up --build— postgres and backend both come up healthycurl http://localhost:3000/health— returns{ "status": "ok" }docker compose down -v && docker compose up --build— clean boot with PostGIS extensions created on first run (check logs forCREATE EXTENSION)