feat(docker): application build via docker#2037
feat(docker): application build via docker#2037zaidmasri wants to merge 3 commits intoGibbonEdu:v31.0.00from
Conversation
|
@SKuipers is there anything I can do to help make this easier for your review? |
|
Hi @zaidmasri Thank you so much for your PR, my sincere apologies for the delay in responding. I have kept trying to find a moment to have a look, with the Christmas break leading into Chinese New Year (a busy time of year in Hong Kong). There was another PR started with a Docker file as well, I wonder if these are compatible of if your new docker compose file would supersede it? Thanks again for your contribution, we greatly appreciate it. At the moment we're a very small team with limited capacity, but we are keen to modernize the codebase with these types of improvements. |
|
Hi @zaidmasri Thanks for submitting this. Docker support is a great addition to Gibbon! I've reviewed the Dockerfile in detail and fixed a few minor issues mainly for consistency. I've opened a follow-up PR with fixes applied and fully tested. PR: https://github.com/GibbonEdu/core/pull/2077/commits. All of the above have been fixed and tested in my PR. The updated setup was verified on macOS (Apple Silicon, Docker 29.2.1). The installer loads cleanly, all system requirement checks pass, and the database connection succeeds. Before the changes are merged, could you please take a look and review and test the changes there? Please take a look and let me know if you have any questions. Happy to discuss any of the changes. |
Description
This PR introduces a Docker-based local development environment for Gibbon Core. It modernizes the repository's tooling by providing a standardized containerized setup, eliminating "works on my machine" issues.
The setup is split into two modular configuration files:
docker-compose.yaml: The base configuration defining the core services (appanddb), networks, and volumes suitable for production-like builds.docker-compose.dev.yaml: A development override that exposes ports (e.g.,8080) and sets environment variables specifically for local testing.Motivation and Context
Currently, setting up a local Gibbon development environment requires manually configuring PHP, Apache, and MySQL, which can be error-prone and inconsistent across operating systems (macOS, Windows, Linux).
This change solves the following problems:
bcmath,intl,gd, etc.) required by Gibbon v31+.How Has This Been Tested?
I have tested these changes on macOS (Intel) using Docker Compose CLI and deployed to a production-like environment using Coolify.
Test Scenarios:
http://localhost:8080.appcontainer can successfully communicate with thedbcontainer using the hostnamedband default credentials.bcmath,gd,zip) are loaded and functional.How to Run (Instructions for Reviewers)
Option 1: Local Development (Recommended)
This command uses the override file to expose the app on port
8080.dbgibbon/gibbonpassOption 2: Production/Base Build
To test the standalone base configuration (no ports exposed to host by default, mimics production internal networking):
Shutdown:
To stop containers and remove volumes (resetting the database):
Screenshots
Local

VPS
Below is the configuration used to deploy this branch via Coolify. By pointing the setup wizard to the fork containing these Docker files, the platform automatically handled the build and deployment process without manual intervention.
Future Enhancements
Dynamic Extension Loading: Support for installing additional PHP extensions via build arguments or configuration files.
CI/CD Pipeline Integration: Automate the build and publication of the Docker image to a container registry (e.g., GHCR). This will allow users to pull a pre-built image rather than building from source locally.
Headless Provisioning: Enable full instance configuration via environment variables to bypass the web-based installation wizard, facilitating automated/unattended deployments.
I would appreciate your feedback on edge cases you perceive, particularly if I were to use this as a production build