mautic / docker-mautic

Docker Image for Mautic
https://www.mautic.org
374 stars 278 forks source link

new way of making images #238

Closed mollux closed 8 months ago

mollux commented 1 year ago

This PR provided a new way of generating Docker images for Mautic 5.

The main differences with the previous M4 version are:

See the readme for more context, and the the examples folder contains ready-to-use.

LyVanBong commented 1 year ago

why not update image

vinyll commented 9 months ago

You should update your user gitignore to avoid files and folders that are specific to your laptop:

echo ".DS_Store" >> ~/.gitignore
vinyll commented 9 months ago

I was trying to test out the fpm build with docker build ./fpm and got the error below.

 => CACHED [stage-1  5/13] RUN apt-get update && apt-get install --no-install-recommends -y     unzip libwebp-dev libzip-dev libfreetype6-dev libjpeg62-turbo-dev libpng-dev  0.0s
 => ERROR [stage-1  6/13] COPY ./common/php.ini /usr/local/etc/php/php.ini                                                                                                    0.0s
 => ERROR [stage-1  7/13] COPY ./common/docker-entrypoint.sh /entrypoint.sh                                                                                                   0.0s
 => ERROR [stage-1  8/13] COPY ./common/entrypoint_mautic_web.sh /entrypoint_mautic_web.sh                                                                                    0.0s
 => ERROR [stage-1  9/13] COPY ./common/entrypoint_mautic_cron.sh /entrypoint_mautic_cron.sh                                                                                  0.0s
 => ERROR [stage-1 10/13] COPY ./common/entrypoint_mautic_worker.sh /entrypoint_mautic_worker.sh                                                                              0.0s
 => CACHED [stage-1 11/13] RUN ["chmod", "+x", "/entrypoint.sh", "/entrypoint_mautic_web.sh", "/entrypoint_mautic_cron.sh", "/entrypoint_mautic_worker.sh"]                   0.0s
 => ERROR [stage-1 12/13] COPY ./common/supervisord.conf /etc/supervisor/conf.d/supervisord.conf                                                                              0.0s
------
 > [stage-1  6/13] COPY ./common/php.ini /usr/local/etc/php/php.ini:
------
------
 > [stage-1  7/13] COPY ./common/docker-entrypoint.sh /entrypoint.sh:
------
------
 > [stage-1  8/13] COPY ./common/entrypoint_mautic_web.sh /entrypoint_mautic_web.sh:
------
------
 > [stage-1  9/13] COPY ./common/entrypoint_mautic_cron.sh /entrypoint_mautic_cron.sh:
------
------
 > [stage-1 10/13] COPY ./common/entrypoint_mautic_worker.sh /entrypoint_mautic_worker.sh:
------
------
 > [stage-1 12/13] COPY ./common/supervisord.conf /etc/supervisor/conf.d/supervisord.conf:
------
Dockerfile:101
--------------------
  99 |         MAUTIC_WORKERS_CONSUME_FAILED=2
 100 |     
 101 | >>> COPY ./common/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
 102 |     
 103 |     # Define Mautic volumes to persist data
--------------------
ERROR: failed to solve: failed to compute cache key: failed to calculate checksum of ref ce695d5e-5bdd-4b5d-9f15-e3f3d43c9763::pj788a3mlqfl1pan0fpsx0rx2: "/common/supervisord.conf": not found

despite the file exists:

ls -l common 
total 48
-rw-r--r--@ 1 vinyll  staff   297 Jan 11 20:35 docker-entrypoint.sh
-rw-r--r--@ 1 vinyll  staff   675 Jan 11 20:35 entrypoint_mautic_cron.sh
-rw-r--r--@ 1 vinyll  staff  1625 Jan 11 20:35 entrypoint_mautic_web.sh
-rw-r--r--@ 1 vinyll  staff    68 Jan 11 20:35 entrypoint_mautic_worker.sh
-rw-r--r--@ 1 vinyll  staff   316 Jan 11 20:35 php.ini
-rw-r--r--@ 1 vinyll  staff  1083 Jan 11 20:35 supervisord.conf
mollux commented 9 months ago

@vinyll did you check this PR or the main branch in the repo? As https://github.com/mautic/docker-mautic/pull/238/files#diff-e2eb93a61ffd7877ea5c751abcb3a618e8e2e9a2073a27f66d4114fe10819f86 removes that file :)

mollux commented 9 months ago

@vinyll does docker build -f fpm/Dockerfile . work?

vinyll commented 9 months ago

@vinyll did you check this PR or the main branch in the repo? As https://github.com/mautic/docker-mautic/pull/238/files#diff-e2eb93a61ffd7877ea5c751abcb3a618e8e2e9a2073a27f66d4114fe10819f86 removes that file :)

Right, I was just reviewing from the Github interface and that was just not totally clear to me. It makes total sense then! :)

vinyll commented 9 months ago

@vinyll does docker build -f fpm/Dockerfile . work?

Wow, it did! The step [mautic builder 4/7] RUN docker-php-ext-configure gd… was time-taking (> 15 min) despite a high speed internet and laptop.

I had less success running it with the docker compose as the line below took beyond an hour:

 => => # > mautic@0.0.0 build                                                                                                                                                      
 => => # > webpack --mode production  --config webpack.config.js                                                                                                                  
 => => # Modernizr build saved to node_modules/modernizr/modernizr-mautic-dist.js   

But that's a different topic!

It seems to be building on my Macbook M2 👍

ghostdevv commented 9 months ago

Is there a planned merge date for this PR? :pray:

lumnn commented 9 months ago

Either README needs changing to mention new MYSQL_* variables or they should have fall back to previous MAUTIC_DB_*

odhekar commented 8 months ago

It seems the REST API doesn't when I use the v5 image. Tried with both oauth2 and basic auth. I have tried /contacts and /segments and while both return correct total count, the rest of the response returns empty

{
    "total": "2",
    "contacts": {
        "1": {},
        "2": {}
    }
}

I have tried usual clear cache, restarts etc. but still couldn't get proper response.

I am just trying out mautic for the first time and wanted to use latest images. am I missing a step to enable something for REST API in the container?

Edit: I have tried v4.4.11 and v5.0.2, both had the same issue.

odhekar commented 8 months ago

went back to "old way" and 4.4.11 based image works fine for API calls.

ghostdevv commented 8 months ago

I think I also ran into this: https://github.com/mautic/mautic/issues/13243

mollux commented 8 months ago

@odhekar @ghostdevv the is indeed an issue with the API for composer based installs, and these Docker images use composer under the hood, so are also impacted. I made a PR to address this that will be in the 5.0.3 release

mollux commented 8 months ago

I'm ready to merge this, so if anyone wan'ts to have a last look, now is the time.

The pipeline is running, and once successful, the images should pop up on https://github.com/mollux/docker-mautic/pkgs/container/docker-mautic and https://hub.docker.com/r/molluxmollux/test-mautic and

Once merged, I will change the upstream registry to be https://hub.docker.com/r/mautic/mautic

mollux commented 8 months ago

thanks! I'll merge, adapt the config to point to the correct upstreams and release the Docker images afterwards