Skip to content

Docker environment improvements - #158

Merged
mateuscruz merged 9 commits into
mainfrom
docker-environment-improvements
Oct 8, 2025
Merged

Docker environment improvements#158
mateuscruz merged 9 commits into
mainfrom
docker-environment-improvements

Conversation

@mateuscruz

@mateuscruz mateuscruz commented Oct 4, 2025

Copy link
Copy Markdown
Member

Summary

This PR refactors the Docker setup and improves the development workflow for the project.

🐳 Docker Infrastructure Improvements

  • Reorganized PostgreSQL Docker files: Moved docker/postgres_primary.dockerfile and docker/postgres_replica.dockerfile to proper directory structures (docker/postgres_primary/Dockerfile and docker/postgres_replica/Dockerfile)
  • Enhanced health checks: Added common health check configuration with improved timing (5s interval, 10s timeout, 30 retries)
  • Better service dependencies: Updated docker-compose.yml to use proper health check conditions for service startup ordering
  • Added persistent volumes: Added MariaDB, PostgreSQL primary, and replica volumes for data persistence
  • Improved PostgreSQL replica startup: Replaced cmd.sh with a more robust start_server script that handles container restarts gracefully

🔧 Development Workflow Enhancements

  • New execution helper: Added bin/exec-latest script to easily run commands against the latest Active Record version
  • Better Dockerfile: Added default CMD to start IRB session for easier development
  • Enhanced .dockerignore: Expanded to exclude more development artifacts and temporary files

📝 CI/CD Updates

  • Updated GitHub Actions: Modified workflow files to reference the new Docker file locations
  • Consistent SHA calculation: Updated all workflows to use the new file paths for cache invalidation

📦 Version Bump

  • Bumped app image tag from v0.9.0.3 to v0.9.0.4

🛠️ Technical Improvements

  • PostgreSQL replica resilience: The new startup script preserves existing data on container restarts, avoiding unnecessary full re-synchronization
  • Better error handling: Added proper error handling and logging in the replica startup process
  • Standardized file permissions: Ensured proper PostgreSQL data directory permissions

These changes improve the development experience, make the Docker setup more robust, and provide better tooling for working with multiple Active Record versions.


Edit: this PR description was made with AI. The code changes are AI free 😎.

@mateuscruz mateuscruz self-assigned this Oct 4, 2025
@mateuscruz
mateuscruz force-pushed the docker-environment-improvements branch from e7e091d to cdf2835 Compare October 4, 2025 04:41
@mateuscruz
mateuscruz marked this pull request as ready for review October 4, 2025 04:48
@mateuscruz
mateuscruz requested a review from malaguitte October 6, 2025 16:05
@mateuscruz
mateuscruz force-pushed the docker-environment-improvements branch from cdf2835 to 6d0e1c2 Compare October 7, 2025 21:34

@malaguitte malaguitte 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 🚀

Comment thread docker-compose.yml
Comment thread docker/postgres_replica/Dockerfile
Comment thread docker/postgres_replica/start_server Outdated
@mateuscruz
mateuscruz force-pushed the docker-environment-improvements branch from e5c1b64 to a9b129e Compare October 8, 2025 17:11
@mateuscruz
mateuscruz merged commit 174084f into main Oct 8, 2025
21 checks passed
@mateuscruz
mateuscruz deleted the docker-environment-improvements branch October 8, 2025 17:19
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.

2 participants