Consolidate Dockerfile stages: combine staging and httpd_serve #236
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.
This PR consolidates the redundant Docker configurations by merging
.github/scripts/staging/Dockerfile
into the mainhttpd_serve
stage in the rootDockerfile
.Problem
The repository had two nearly identical Docker configurations:
Dockerfile
withhttpd_serve
stage (used for development).github/scripts/staging/Dockerfile
(used for CI/CD staging tests)Both configurations used the same base image (
httpd:2.4.64
), installed the same dependencies (curl
), and served Apache content with similar configurations, creating unnecessary maintenance overhead.Solution
Enhanced the
httpd_serve
stage to intelligently handle both use cases:_site/
): Useshttpd.conf
copied by the workflowdefault.conf
from.github/scripts/staging/
Updated docker-compose.yml staging service to use the consolidated
httpd_serve
target instead of the separate Dockerfile.Modified the staging workflow to properly prepare the build context with required configuration files.
Example Usage
Development (unchanged):
Staging (now uses consolidated approach):
The staging service automatically detects the build context and uses the appropriate Apache configuration, maintaining full compatibility with existing workflows while eliminating code duplication.
Benefits:
Fixes #235.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.