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
9 changes: 9 additions & 0 deletions .all-contributorsrc
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,15 @@
"contributions": [
"code"
]
},
{
"login": "kiart-tantasi",
"name": "Kiart Tantasi",
"avatar_url": "https://avatars.githubusercontent.com/u/76615399?v=4",
"profile": "https://www.petchblog.net/",
"contributions": [
"code"
]
}
],
"contributorsPerLine": 7,
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Official Mautic Docker Image
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
[![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-)
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)
<!-- ALL-CONTRIBUTORS-BADGE:END -->

> [!NOTE]
Expand Down Expand Up @@ -213,6 +213,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
<td align="center" valign="top" width="14.28%"><a href="https://github.com/maxitromer"><img src="https://avatars.githubusercontent.com/u/6311835?v=4?s=100" width="100px;" alt="maxitromer"/><br /><sub><b>maxitromer</b></sub></a><br /><a href="https://github.com/mautic/docker-mautic/commits?author=maxitromer" title="Code">💻</a> <a href="https://github.com/mautic/docker-mautic/commits?author=maxitromer" title="Tests">⚠️</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/nick-vanpraet"><img src="https://avatars.githubusercontent.com/u/7923739?v=4?s=100" width="100px;" alt="Nick Vanpraet"/><br /><sub><b>Nick Vanpraet</b></sub></a><br /><a href="https://github.com/mautic/docker-mautic/pulls?q=is%3Apr+reviewed-by%3Anick-vanpraet" title="Reviewed Pull Requests">👀</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://druid.fi"><img src="https://avatars.githubusercontent.com/u/1140272?v=4?s=100" width="100px;" alt="Marko Korhonen"/><br /><sub><b>Marko Korhonen</b></sub></a><br /><a href="https://github.com/mautic/docker-mautic/commits?author=back-2-95" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.petchblog.net/"><img src="https://avatars.githubusercontent.com/u/76615399?v=4?s=100" width="100px;" alt="Kiart Tantasi"/><br /><sub><b>Kiart Tantasi</b></sub></a><br /><a href="https://github.com/mautic/docker-mautic/commits?author=kiart-tantasi" title="Code">💻</a></td>
</tr>
</tbody>
</table>
Expand Down
4 changes: 2 additions & 2 deletions apache/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.3-apache AS builder
FROM php:8.3-apache-bookworm AS builder

# Copy everything from common for building
COPY ./common/ /common/
Expand Down Expand Up @@ -63,7 +63,7 @@ RUN cd /opt && \
rm -rf /opt/mautic/var/cache/js && \
find /opt/mautic/node_modules -mindepth 1 -maxdepth 1 -not \( -name 'jquery' -or -name 'vimeo-froogaloop2' \) | xargs rm -rf

FROM php:8.3-apache
FROM php:8.3-apache-bookworm

LABEL vendor="Mautic"
LABEL maintainer="Mautic core team <>"
Expand Down
6 changes: 5 additions & 1 deletion common/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ export MAUTIC_DB_PORT="${MAUTIC_DB_PORT:-3306}"
export MAUTIC_VOLUME_CONFIG="${MAUTIC_VOLUME_CONFIG:-/var/www/html/config}"
export MAUTIC_VOLUME_LOGS="${MAUTIC_VOLUME_LOGS:-/var/www/html/var/logs}"
export MAUTIC_VOLUME_MEDIA="${MAUTIC_VOLUME_MEDIA:-/var/www/html/docroot/media}"
export MAUTIC_VOLUME_FILES="${MAUTIC_VOLUME_FILES:-/var/www/html/docroot/media/files}"
export MAUTIC_VOLUME_IMAGES="${MAUTIC_VOLUME_IMAGES:-/var/www/html/docroot/media/images}"

export MAUTIC_VAR="${MAUTIC_VAR:-/var/www/html/var}"
export MAUTIC_CONSOLE="${MAUTIC_CONSOLE:-/var/www/html/bin/console}"
Expand All @@ -25,7 +27,9 @@ export MAUTIC_VOLUMES="\
${MAUTIC_VOLUME_CONFIG} \
${MAUTIC_VAR} \
${MAUTIC_VOLUME_LOGS} \
${MAUTIC_VOLUME_MEDIA}"
${MAUTIC_VOLUME_MEDIA} \
${MAUTIC_VOLUME_FILES} \
${MAUTIC_VOLUME_IMAGES} "

export REQUIRED_MAUTIC_VARIABLES="\
MAUTIC_DB_HOST \
Expand Down
9 changes: 8 additions & 1 deletion common/entrypoint_mautic_web.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

source /startup/logger.sh

# prepare mautic with test data
if [ "$DOCKER_MAUTIC_LOAD_TEST_DATA" = "true" ]; then
su -s /bin/bash $MAUTIC_WWW_USER -c "php $MAUTIC_CONSOLE doctrine:migrations:sync-metadata-storage"
Expand All @@ -9,7 +11,12 @@ if [ "$DOCKER_MAUTIC_LOAD_TEST_DATA" = "true" ]; then
fi

# run migrations
su -s /bin/bash $MAUTIC_WWW_USER -c "php $MAUTIC_CONSOLE doctrine:migration:migrate -n"
if php -r "include('${MAUTIC_VOLUME_CONFIG}/local.php'); exit(!empty(\$parameters['db_driver']) && !empty(\$parameters['site_url']) ? 0 : 1);"; then
log "[${DOCKER_MAUTIC_ROLE}]: Mautic is already installed, running migrations..."
su -s /bin/bash $MAUTIC_WWW_USER -c "php $MAUTIC_CONSOLE doctrine:migrations:migrate -n"
else
log "[${DOCKER_MAUTIC_ROLE}]: Mautic is not installed, skipping migrations."
fi

# execute the provided entrypoint
"$@"
2 changes: 1 addition & 1 deletion common/startup/check_volumes_exist_ownership.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function check_volumes_exist_ownership {

if [[ $ERROR_FOUND -eq 1 ]]; then
log_startup_error_header
log_error "Please ensure the volume(s) are mounted correctly and is accessible."
log_error "Please ensure the volume(s) is mounted correctly and is accessible."
log_error "If you are running this container as a non-root user, you may need to run the container with elevated privileges."
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion common/startup/wait_for_mautic_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ source /startup/logger.sh

function wait_for_mautic_install {
local COUNTER=0
until php -r "include('${MAUTIC_VOLUME_CONFIG}/local.php'); exit(isset(\$parameters['site_url']) ? 0 : 1);"; do
until php -r "include('${MAUTIC_VOLUME_CONFIG}/local.php'); exit(!empty(\$parameters['db_driver']) && !empty(\$parameters['site_url']) ? 0 : 1);"; do
log_debug "[${DOCKER_MAUTIC_ROLE}]: Waiting for Mautic to be installed, current attempt: ${COUNTER}."
# only show message every 30 seconds (or DEBUG is enabled)
if (( COUNTER % 6 == 0 )); then
Expand Down
2 changes: 1 addition & 1 deletion examples/basic/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ services:
links:
- db:mysql
ports:
- 1111:80
- 8080:80
volumes: *mautic-volumes

environment:
Expand Down
4 changes: 2 additions & 2 deletions fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.3-fpm AS builder
FROM php:8.3-fpm-bookworm AS builder

# Copy everything from common for building
COPY ./common/ /common/
Expand Down Expand Up @@ -63,7 +63,7 @@ RUN cd /opt && \
rm -rf /opt/mautic/var/cache/js && \
find /opt/mautic/node_modules -mindepth 1 -maxdepth 1 -not \( -name 'jquery' -or -name 'vimeo-froogaloop2' \) | xargs rm -rf

FROM php:8.3-fpm
FROM php:8.3-fpm-bookworm

LABEL vendor="Mautic"
LABEL maintainer="Mautic core team <>"
Expand Down
Loading