publish Docker images to GHCR, and optimize web Dockerfile#3433
Closed
Mateusz-Krajewski wants to merge 3 commits into
Closed
publish Docker images to GHCR, and optimize web Dockerfile#3433Mateusz-Krajewski wants to merge 3 commits into
Mateusz-Krajewski wants to merge 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to improve Docker-based deployments by publishing pre-built cloudlog-web / cloudlog-db images to GHCR and streamlining the PHP Apache image build, while adjusting CI and compose files to consume registry images.
Changes:
- Adds a GitHub Actions workflow to build and push multi-arch Docker images to GHCR.
- Updates the Cypress CI workflow and dev compose configuration to start services via compose with registry images.
- Optimizes the web
Dockerfileand adds a.dockerignoreto reduce build context size.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
Dockerfile |
Consolidates APT + PHP extension install steps and writes uploads.ini more cleanly. |
docker-compose.yml |
Sets image: for web/db services (while keeping build: for dev). |
.github/workflows/docker-publish.yml |
Introduces GHCR publish workflow using Buildx/QEMU and metadata-action tags. |
.github/workflows/cypress-tests.yml |
Switches CI stack startup to docker-compose.prod.yml with a pull step. |
.env.sample |
Documents optional GHCR image override variables (commented). |
.dockerignore |
Excludes large directories to reduce Docker build context. |
|
|
||
| on: | ||
| push: | ||
| tags: |
Comment on lines
+52
to
+53
| docker compose -f docker-compose.prod.yml pull | ||
| docker compose -f docker-compose.prod.yml up -d |
Comment on lines
+52
to
+53
| docker compose -f docker-compose.prod.yml pull | ||
| docker compose -f docker-compose.prod.yml up -d |
Comment on lines
+12
to
+15
| image: ghcr.io/magicbug/cloudlog-web:latest | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile |
Comment on lines
1
to
3
| FROM php:7.4-apache | ||
|
|
||
| # Set the working directory to /var/www/html | ||
| WORKDIR /var/www/html |
| restart: on-failure | ||
|
|
||
| db: | ||
| image: ghcr.io/magicbug/cloudlog-db:latest |
75cc085 to
7cac2a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Improve deployments using pre-built container images and speed up / slim down the PHP Apache image build.
Changes
docker-publish): Build and pushcloudlog-webandcloudlog-dbto GitHub Container Registry (ghcr.io). Tags follow semver (MAJOR.MINOR.PATCH), plusworkflow_dispatch. Multi-archlinux/amd64andlinux/arm64only (nolinux/arm/v7for the DB image—the official MariaDB image does not ship that variant).docker-compose.yml(development: local build + bind mount) anddocker-compose.prod.yml(registry images only). Document optionalCLOUDLOG_IMAGE_*overrides in.env.samplewhere applicable.docker-compose.prod.yml(pullthenup).Dockerfile: Single layer for APT cleanup + PHP extensions (docker-php-ext-install -j$(nproc)),--no-install-recommends, enablecurlPHP extension (used by the app), writeuploads.iniwithprintf, fewer layers overall..dockerignore: Much smaller build context by excluding large dirs (e.g.application/,assets/,node_modules,cypress/) while keepingscript.shandinstall/for the DB image.Notes for reviewers
docker compose pullworks in prod/CI without a localbuild.