Skip to content

Docker deployment#32

Merged
jacob-a-brown merged 42 commits into
pre-productionfrom
jab-poc
Jul 22, 2025
Merged

Docker deployment#32
jacob-a-brown merged 42 commits into
pre-productionfrom
jab-poc

Conversation

@jacob-a-brown

Copy link
Copy Markdown
Contributor

This PR...

  • sets up docker containers for both the database and the app
    • deprecates timescale database docker image for postgis docker image
  • describes two migrations to have an up-to-date database
  • uses environment variables throughout to make sql connection strings
  • adds pre-commit to pyproject and uv lock to be used locally (and configures the pre-commit hooks)

jacob-a-brown and others added 30 commits July 14, 2025 15:17
This commit includes the following changes:

- Added a new `docker-compose.yml` file to manage multi-container Docker applications.
- Updated the `Dockerfile` in the `docker/app` directory to:
    - Install system dependencies for `psycopg2` and `uv`.
- Copy the full project source into the Docker image.

Future work will include putting docker-compose.yml into the docker directory
This spatial index is automatically created by PostGIS when the
`point` column is created, and it can cause issues with the migration
if it already exists. This change ensures that the index is dropped
before the migration runs, preventing potential conflicts.
This commit ensures that the index `idx_location_point` is dropped if it exists before creating a new one. This prevents errors during migrations when the index already exists.
This is particularly useful in environments where the database schema may have been modified manually or by previous migrations.
This change is part of the initial migration setup to ensure a clean state for the `location`
Use flexible include_object function to exclude specific tables from migrations.
Ensure entrypoint script is executable and correctly handles database migrations.
This commit ensures that the index `idx_location_point` is dropped if it exists before attempting to create it again. This prevents errors during migrations when the index already exists.
This change is made in the Alembic migration script `5901f059248a_initial_migration.py` and the Dockerfile for the application.
This allows the migration scripts to be created with the correct database host depending on the environment.
jacob-a-brown and others added 12 commits July 22, 2025 12:05
This allows the env variables to be set for the docker containers
to talk with each other - that is, host must be "db" for the
app to connect to the database because in Docker, the host should be
the name of the database service, not localhost.
This should be there for all to use. The database connection strings
are now made through environment variables, which are set in the
appropriate yaml/.env/secrets files.

@chasetmartin chasetmartin left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@jacob-a-brown jacob-a-brown merged commit 70b4253 into pre-production Jul 22, 2025
3 checks passed
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.

4 participants