Skip to content

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 4, 2025

This PR consolidates the redundant Docker configurations by merging .github/scripts/staging/Dockerfile into the main httpd_serve stage in the root Dockerfile.

Problem

The repository had two nearly identical Docker configurations:

  • Main Dockerfile with httpd_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:

  • Staging context (building from _site/): Uses httpd.conf copied by the workflow
  • Development context (building from root): Uses default.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):

docker compose up http_serve

Staging (now uses consolidated approach):

docker compose up --build staging

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:

  • Reduced maintenance overhead with single source of truth
  • Preserved all existing functionality and health checks
  • Improved consistency between development and staging environments
  • Simplified CI/CD pipeline configuration

Fixes #235.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: dannystaple <426859+dannystaple@users.noreply.github.com>
@Copilot Copilot AI changed the title [WIP] Combine Dockerfile and .github/scripts/staging/Dockerfile Consolidate Dockerfile stages: combine staging and httpd_serve Aug 4, 2025
@Copilot Copilot AI requested a review from dannystaple August 4, 2025 14:16
Copilot finished work on behalf of dannystaple August 4, 2025 14:16
Copy link
Contributor

github-actions bot commented Aug 4, 2025

🦙 MegaLinter status: ❌ ERROR

Descriptor Linter Files Fixed Errors Warnings Elapsed time
❌ ACTION actionlint 5 6 0 0.07s
✅ BASH bash-exec 1 0 0 0.0s
✅ BASH shellcheck 1 0 0 0.04s
⚠️ BASH shfmt 1 1 0 0.0s
❌ C cppcheck 8 8 0 0.21s
❌ CPP cppcheck 8 8 0 0.33s
✅ JSON npm-package-json-lint yes no no 0.43s
✅ JSON v8r 12 0 0 8.72s
❌ MARKDOWN markdown-link-check 736 213 0 36.14s
✅ REPOSITORY gitleaks yes no no 13.39s
✅ REPOSITORY git_diff yes no no 0.03s
✅ REPOSITORY grype yes no no 34.73s
✅ REPOSITORY secretlint yes no no 42.38s
✅ REPOSITORY syft yes no no 1.9s
✅ REPOSITORY trivy-sbom yes no no 3.38s
✅ REPOSITORY trufflehog yes no no 4.64s
✅ XML xmllint 1 0 0 201.98s
✅ YAML v8r 13 0 0 7.55s

See detailed report in MegaLinter reports

MegaLinter is graciously provided by OX Security

@dannystaple dannystaple marked this pull request as ready for review August 4, 2025 16:04
@dannystaple dannystaple merged commit 1b6a944 into master Aug 4, 2025
4 checks passed
@dannystaple dannystaple deleted the copilot/fix-235 branch August 4, 2025 16:05
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.

Combine Dockerfile and .github/scripts/staging/Dockerfile
2 participants