Skip to content

publish Docker images to GHCR, and optimize web Dockerfile#3433

Closed
Mateusz-Krajewski wants to merge 3 commits into
magicbug:masterfrom
Mateusz-Krajewski:makr-add-docker-packages
Closed

publish Docker images to GHCR, and optimize web Dockerfile#3433
Mateusz-Krajewski wants to merge 3 commits into
magicbug:masterfrom
Mateusz-Krajewski:makr-add-docker-packages

Conversation

@Mateusz-Krajewski
Copy link
Copy Markdown

Summary

Improve deployments using pre-built container images and speed up / slim down the PHP Apache image build.

Changes

  • GitHub Actions (docker-publish): Build and push cloudlog-web and cloudlog-db to GitHub Container Registry (ghcr.io). Tags follow semver (MAJOR.MINOR.PATCH), plus workflow_dispatch. Multi-arch linux/amd64 and linux/arm64 only (no linux/arm/v7 for the DB image—the official MariaDB image does not ship that variant).
  • Compose: Split docker-compose.yml (development: local build + bind mount) and docker-compose.prod.yml (registry images only). Document optional CLOUDLOG_IMAGE_* overrides in .env.sample where applicable.
  • Cypress CI: Start the stack from docker-compose.prod.yml (pull then up).
  • Web Dockerfile: Single layer for APT cleanup + PHP extensions (docker-php-ext-install -j$(nproc)), --no-install-recommends, enable curl PHP extension (used by the app), write uploads.ini with printf, fewer layers overall.
  • .dockerignore: Much smaller build context by excluding large dirs (e.g. application/, assets/, node_modules, cypress/) while keeping script.sh and install/ for the DB image.

Notes for reviewers

  • The first successful workflow run must publish images before docker compose pull works in prod/CI without a local build.
  • GHCR package visibility may need to be set to public if you want anonymous image pulls.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Dockerfile and adds a .dockerignore to 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 thread .github/workflows/cypress-tests.yml Outdated
Comment on lines +52 to +53
docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml up -d
Comment thread .github/workflows/cypress-tests.yml Outdated
Comment on lines +52 to +53
docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml up -d
Comment thread docker-compose.yml
Comment on lines +12 to +15
image: ghcr.io/magicbug/cloudlog-web:latest
build:
context: .
dockerfile: Dockerfile
Comment thread Dockerfile
Comment on lines 1 to 3
FROM php:7.4-apache

# Set the working directory to /var/www/html
WORKDIR /var/www/html
Comment thread docker-compose.yml
restart: on-failure

db:
image: ghcr.io/magicbug/cloudlog-db:latest
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