Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 58 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Build And Publish Container

on:
push:
branches:
- main
- dev
tags:
- 'v*'
workflow_dispatch:
Comment thread
TatevikGr marked this conversation as resolved.

env:
# todo: change to phplist dockerhub
DOCKERHUB_IMAGE: tatevikg1/phplist4
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Major: Use organization Docker Hub account instead of personal account.

The workflow uses tatevikg1/phplist4, which appears to be a personal Docker Hub account. For the official phpList project, this should use an organization account (e.g., phplist/base-distribution or similar) to ensure:

  • Proper ownership and access control
  • Continuity if the personal account becomes unavailable
  • Professional branding for the official project
📝 Suggested change
 env:
-  DOCKERHUB_IMAGE: tatevikg1/phplist4
+  DOCKERHUB_IMAGE: phplist/base-distribution

Note: Update the corresponding secrets to use the organization account credentials.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
DOCKERHUB_IMAGE: tatevikg1/phplist4
env:
DOCKERHUB_IMAGE: phplist/base-distribution
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/docker-publish.yml at line 15, The workflow is publishing
to a personal Docker Hub image: the DOCKERHUB_IMAGE variable currently set to
"tatevikg1/phplist4" should be changed to the official organization image (e.g.,
"phplist/base-distribution" or your org's canonical repo) to ensure proper
ownership and continuity; update the DOCKERHUB_IMAGE value in the workflow and
also rotate/update any related secrets (Docker Hub username/password or token
referenced by the workflow) to use the organization account credentials so the
publish step continues to authenticate and push successfully.


jobs:
docker:
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Log in to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ env.DOCKERHUB_IMAGE }}
tags: |
type=raw,value=latest,enable={{is_default_branch}}
type=raw,value=test,enable=${{ github.ref == 'refs/heads/dev' }}
type=ref,event=tag
type=sha,prefix=sha-
Comment thread
coderabbitai[bot] marked this conversation as resolved.

- name: Build and push image
uses: docker/build-push-action@v6
with:
context: .
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

12 changes: 8 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
services:
app:
build: .
# todo: change to phplist dockerhub
image: tatevikg1/phplist:test
Comment thread
TatevikGr marked this conversation as resolved.
container_name: base-distribution-app
ports:
- "${PHPLIST_PORT:-8081}:80"
- "${PHPLIST_PORT:-8081}:8081"
environment:
# Database connection (mirrors config/parameters.yml expectations)
PHPLIST_DATABASE_NAME: phplistdb
Expand All @@ -13,9 +14,9 @@ services:
PHPLIST_DATABASE_DRIVER: ${PHPLIST_DATABASE_DRIVER:-pdo_mysql} # pdo_pgsql
PHPLIST_DATABASE_HOST: ${PHPLIST_DATABASE_HOST:-db} # postgres
PHPLIST_DATABASE_PORT: ${PHPLIST_DATABASE_PORT:-3306} # 5432
REST_API_BASE_URL: 'http://app/'
FRONT_END_BASE_URL: 'http://app/'
API_BASE_URL: 'http://app/'
REST_API_BASE_URL: 'http://app:8081/'
FRONT_END_BASE_URL: 'http://app:8081/'
API_BASE_URL: 'http://app:8081/'

# Symfony environment
APP_ENV: prod
Expand All @@ -25,6 +26,9 @@ services:
volumes:
- ./var/logs:/var/www/html/var/log
- ./var/cache:/var/www/html/var/cache
- ./docker/apache/servername.conf:/etc/apache2/conf-enabled/servername.conf:ro
- ./docker/apache/ports.conf:/etc/apache2/ports.conf:ro
- ./docker/apache/000-default.conf:/etc/apache2/sites-available/000-default.conf:ro
networks: [ appnet ]

command: >
Expand Down
12 changes: 12 additions & 0 deletions docker/apache/000-default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<VirtualHost *:8081>
ServerName app
DocumentRoot /var/www/html/public

<Directory /var/www/html/public>
AllowOverride All
Require all granted
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
1 change: 1 addition & 0 deletions docker/apache/ports.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Listen 8081
1 change: 1 addition & 0 deletions docker/apache/servername.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ServerName app
Loading