# Adding composer for symphony amazon-mailer inside docker

**URL:** <https://forum.mautic.org/t/adding-composer-for-symphony-amazon-mailer-inside-docker/31305>\
**Category:** Mautic 5 Install/Upgrade Support\
**Created:** [March 16, 2024, 5:29pm UTC](https://forum.mautic.org/t/adding-composer-for-symphony-amazon-mailer-inside-docker/31305 "2024-03-16T17:29:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![wifi9823](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/wifi9823/32/10797_2.png) [@wifi9823](https://forum.mautic.org/u/wifi9823)\
**Post date:** [March 16, 2024, 5:29pm UTC](https://forum.mautic.org/t/adding-composer-for-symphony-amazon-mailer-inside-docker/31305/1 "2024-03-16T17:29:51Z")

</div>

**Your software**  
My Mautic version is: official prebuilt v5-apache (docker)

**Your problem**  
My problem is: I want to install composer for amazon-mailer, however, when I try to install inside the mautic\_web container, I get the following error:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/2/22332f3cba2bb090f8a932ab74518fc6049e98db.png)

I’m sure adding composer and subsequently amazon-mailer this way to incorrect since the container is ephemeral in nature.

Is there a way to install composer inside mautic container and use amazon-mailer DSN?

---

<div class="post-metadata">

**Author:** ![DogByteMarketing](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dogbytemarketing/32/11625_2.png) [@DogByteMarketing](https://forum.mautic.org/u/DogByteMarketing)\
**Post date:** [March 17, 2024, 8:24am UTC](https://forum.mautic.org/t/adding-composer-for-symphony-amazon-mailer-inside-docker/31305/2 "2024-03-17T08:24:30Z")

</div>

Are you using docker-compose.yml? If so it’ll make it a bit difficult to troubleshoot without seeing that file. If you only have the Apache image, it doesn’t include PHP, which could be the reason those dependencies aren’t installing.

There is also a docker image available:  
[https://hub.docker.com/r/mautic/mautic](https://hub.docker.com/r/mautic/mautic)

This will install all the necessary images and configure everything you need.

---

<div class="post-metadata">

**Author:** ![wifi9823](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/wifi9823/32/10797_2.png) [@wifi9823](https://forum.mautic.org/u/wifi9823)\
**Post date:** [March 17, 2024, 9:41am UTC](https://forum.mautic.org/t/adding-composer-for-symphony-amazon-mailer-inside-docker/31305/3 "2024-03-17T09:41:53Z")

</div>

Here’s a simple docker-compose.yml modified from [docker-mautic/examples/basic at mautic5 · mautic/docker-mautic · GitHub](https://github.com/mautic/docker-mautic/tree/mautic5/examples/basic)

```yaml
version: '3'

x-mautic-volumes:
  &mautic-volumes
  - ./mautic/config:/var/www/html/config:z
  - ./mautic/logs:/var/www/html/var/logs:z
  - ./mautic/media/files:/var/www/html/docroot/media/files:z
  - ./mautic/media/images:/var/www/html/docroot/media/images:z
  - ./cron:/opt/mautic/cron:z

services:
  db:
    image: lscr.io/linuxserver/mariadb:latest
    environment:
      - MYSQL_ROOT_PASSWORD=redacted
      - MYSQL_DATABASE=mautic_db
      - MYSQL_USER=mautic_db_user
      - MYSQL_PASSWORD=mautic_db_pwd123
    volumes: 
      - mysql-data:/var/lib/mysql
    healthcheck:
      test: mysqladmin --user=mautic_db_user --password=mautic_db_pwd ping
      start_period: 5s
      interval: 5s
      timeout: 5s
      retries: 10

  mautic_web:
    image: mautic/mautic:5-apache
    links:
      - db:mysql
    ports:
      - 8001:80
    volumes: *mautic-volumes

    environment:
      - DOCKER_MAUTIC_LOAD_TEST_DATA=false
      - DOCKER_MAUTIC_RUN_MIGRATIONS=false
      - MAUTIC_DB_HOST=db
      - MAUTIC_DB_PORT=3306
      - MAUTIC_DB_DATABASE=mautic_db
      - MAUTIC_DB_USER=mautic_db_user
      - MAUTIC_DB_PASSWORD=mautic_db_pwd123

    healthcheck:
      test: curl http://localhost
      start_period: 5s
      interval: 5s
      timeout: 5s
      retries: 100
    depends_on:
      db:
        condition: service_healthy

  mautic_cron:
    image: mautic/mautic:5-apache
    links:
      - db:mysql
    volumes: *mautic-volumes
    environment:
      - DOCKER_MAUTIC_ROLE=mautic_cron
      - MAUTIC_DB_HOST=db
      - MAUTIC_DB_PORT=3306
      - MAUTIC_DB_DATABASE=mautic_db
      - MAUTIC_DB_USER=mautic_db_user
      - MAUTIC_DB_PASSWORD=mautic_db_pwd123
    depends_on:
      mautic_web:
        condition: service_healthy

  mautic_worker:
    image: mautic/mautic:5-apache
    links:
      - db:mysql
    volumes: *mautic-volumes
    environment:
      - DOCKER_MAUTIC_ROLE=mautic_worker
      - MAUTIC_DB_HOST=db
      - MAUTIC_DB_PORT=3306
      - MAUTIC_DB_DATABASE=mautic_db
      - MAUTIC_DB_USER=mautic_db_user
      - MAUTIC_DB_PASSWORD=mautic_db_pwd123

    depends_on:
      mautic_web:
        condition: service_healthy
volumes:
  mysql-data:

```

I’m using pre-built `mautic/mautic:5-apache` images hosted at docker hub.

> If you only have the Apache image, it doesn’t include PHP, which could be the reason those dependencies aren’t installing.

Will `mautic/mautic:5-fpm` work?

---

<div class="post-metadata">

**Author:** ![DogByteMarketing](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dogbytemarketing/32/11625_2.png) [@DogByteMarketing](https://forum.mautic.org/u/DogByteMarketing)\
**Post date:** [March 17, 2024, 10:29am UTC](https://forum.mautic.org/t/adding-composer-for-symphony-amazon-mailer-inside-docker/31305/4 "2024-03-17T10:29:44Z")

</div>

Per their documentation, their apache image includes php:apache. If you are only using their Docker Compose file, you are just building the images. The Dockerfile is what configures those images. You can see in the [Mautic Dockerfile](https://github.com/mautic/docker-mautic/blob/6ebb1d6a2751fbb029d1e5ebb6c9ae076f55d47f/apache/Dockerfile) that it adds and configures PHP extensions required to use Mautic.

If you pull from Docker Hub it should just work, at least it does for us. Just backup what you have so far just in case.

```auto
docker pull mautic/mautic

```

---

<div class="post-metadata">

**Author:** ![wifi9823](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/wifi9823/32/10797_2.png) [@wifi9823](https://forum.mautic.org/u/wifi9823)\
**Post date:** [March 19, 2024, 5:06am UTC](https://forum.mautic.org/t/adding-composer-for-symphony-amazon-mailer-inside-docker/31305/5 "2024-03-19T05:06:19Z")

</div>

I just saw this mentioned on the github

> Currently this image has no easy way to extend Mautic (e.g. adding extra `composer` dependencies or installing extra plugins or themes).

> This is an ongoing effort we hope to support in an upcoming 5.x release.  
> For now, please build your own images based on the official ones to add the needed dependencies, plugins and themes.

I guess, issue closed. I might build my own custom image.

---

<div class="post-metadata">

**Author:** ![rushagencia](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/rushagencia/32/13084_2.png) [@rushagencia](https://forum.mautic.org/u/rushagencia)\
**Post date:** [May 22, 2024, 11:34pm UTC](https://forum.mautic.org/t/adding-composer-for-symphony-amazon-mailer-inside-docker/31305/6 "2024-05-22T23:34:50Z")

</div>

> [@DogByteMarketing](#):
>
> This will install all the necessary images and configure everything you need.

Hello how are you?  
With this hub.docker image, that is, “docker run… mautic”, it already installs the cron and workers as well or it is necessary to install a container for each, one for mautic, one for cron and one for the worker ?
