Skip to content

Commit c4551cb

Browse files
authored
Merge pull request #446 from mautic/mautic5
sync forks
2 parents d468f3a + 50c296f commit c4551cb

File tree

9 files changed

+31
-10
lines changed

9 files changed

+31
-10
lines changed

.all-contributorsrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,15 @@
119119
"contributions": [
120120
"code"
121121
]
122+
},
123+
{
124+
"login": "kiart-tantasi",
125+
"name": "Kiart Tantasi",
126+
"avatar_url": "https://avatars.githubusercontent.com/u/76615399?v=4",
127+
"profile": "https://www.petchblog.net/",
128+
"contributions": [
129+
"code"
130+
]
122131
}
123132
],
124133
"contributorsPerLine": 7,

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Official Mautic Docker Image
22
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3-
[![All Contributors](https://img.shields.io/badge/all_contributors-12-orange.svg?style=flat-square)](#contributors-)
3+
[![All Contributors](https://img.shields.io/badge/all_contributors-13-orange.svg?style=flat-square)](#contributors-)
44
<!-- ALL-CONTRIBUTORS-BADGE:END -->
55

66
> [!NOTE]
@@ -213,6 +213,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
213213
<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>
214214
<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>
215215
<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>
216+
<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>
216217
</tr>
217218
</tbody>
218219
</table>

apache/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.3-apache AS builder
1+
FROM php:8.3-apache-bookworm AS builder
22

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

66-
FROM php:8.3-apache
66+
FROM php:8.3-apache-bookworm
6767

6868
LABEL vendor="Mautic"
6969
LABEL maintainer="Mautic core team <>"

common/docker-entrypoint.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ export MAUTIC_DB_PORT="${MAUTIC_DB_PORT:-3306}"
1212
export MAUTIC_VOLUME_CONFIG="${MAUTIC_VOLUME_CONFIG:-/var/www/html/config}"
1313
export MAUTIC_VOLUME_LOGS="${MAUTIC_VOLUME_LOGS:-/var/www/html/var/logs}"
1414
export MAUTIC_VOLUME_MEDIA="${MAUTIC_VOLUME_MEDIA:-/var/www/html/docroot/media}"
15+
export MAUTIC_VOLUME_FILES="${MAUTIC_VOLUME_FILES:-/var/www/html/docroot/media/files}"
16+
export MAUTIC_VOLUME_IMAGES="${MAUTIC_VOLUME_IMAGES:-/var/www/html/docroot/media/images}"
1517

1618
export MAUTIC_VAR="${MAUTIC_VAR:-/var/www/html/var}"
1719
export MAUTIC_CONSOLE="${MAUTIC_CONSOLE:-/var/www/html/bin/console}"
@@ -25,7 +27,9 @@ export MAUTIC_VOLUMES="\
2527
${MAUTIC_VOLUME_CONFIG} \
2628
${MAUTIC_VAR} \
2729
${MAUTIC_VOLUME_LOGS} \
28-
${MAUTIC_VOLUME_MEDIA}"
30+
${MAUTIC_VOLUME_MEDIA} \
31+
${MAUTIC_VOLUME_FILES} \
32+
${MAUTIC_VOLUME_IMAGES} "
2933

3034
export REQUIRED_MAUTIC_VARIABLES="\
3135
MAUTIC_DB_HOST \

common/entrypoint_mautic_web.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/bin/bash
22

3+
source /startup/logger.sh
4+
35
# prepare mautic with test data
46
if [ "$DOCKER_MAUTIC_LOAD_TEST_DATA" = "true" ]; then
57
su -s /bin/bash $MAUTIC_WWW_USER -c "php $MAUTIC_CONSOLE doctrine:migrations:sync-metadata-storage"
@@ -9,7 +11,12 @@ if [ "$DOCKER_MAUTIC_LOAD_TEST_DATA" = "true" ]; then
911
fi
1012

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

1421
# execute the provided entrypoint
1522
"$@"

common/startup/check_volumes_exist_ownership.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function check_volumes_exist_ownership {
1313

1414
if [[ $ERROR_FOUND -eq 1 ]]; then
1515
log_startup_error_header
16-
log_error "Please ensure the volume(s) are mounted correctly and is accessible."
16+
log_error "Please ensure the volume(s) is mounted correctly and is accessible."
1717
log_error "If you are running this container as a non-root user, you may need to run the container with elevated privileges."
1818
exit 1
1919
fi

common/startup/wait_for_mautic_install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ source /startup/logger.sh
44

55
function wait_for_mautic_install {
66
local COUNTER=0
7-
until php -r "include('${MAUTIC_VOLUME_CONFIG}/local.php'); exit(isset(\$parameters['site_url']) ? 0 : 1);"; do
7+
until php -r "include('${MAUTIC_VOLUME_CONFIG}/local.php'); exit(!empty(\$parameters['db_driver']) && !empty(\$parameters['site_url']) ? 0 : 1);"; do
88
log_debug "[${DOCKER_MAUTIC_ROLE}]: Waiting for Mautic to be installed, current attempt: ${COUNTER}."
99
# only show message every 30 seconds (or DEBUG is enabled)
1010
if (( COUNTER % 6 == 0 )); then

examples/basic/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ services:
3030
links:
3131
- db:mysql
3232
ports:
33-
- 1111:80
33+
- 8080:80
3434
volumes: *mautic-volumes
3535

3636
environment:

fpm/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:8.3-fpm AS builder
1+
FROM php:8.3-fpm-bookworm AS builder
22

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

66-
FROM php:8.3-fpm
66+
FROM php:8.3-fpm-bookworm
6767

6868
LABEL vendor="Mautic"
6969
LABEL maintainer="Mautic core team <>"

0 commit comments

Comments
 (0)