mautic / docker-mautic

Docker Image for Mautic
https://www.mautic.org
368 stars 276 forks source link

Errors building beta-fpm docker images #124

Open RafaelAybar opened 5 years ago

RafaelAybar commented 5 years ago

Hi, i am trying to build fpm-beta docker image, but i have the following errors:


  Connecting to MAUTIC_DB_HOST (127.0.0.1:3306)
  instead of the linked mysql container

Writing initial Mautic config

Warning: file_put_contents(/var/www/html/app/config/local.php): failed to open stream: No such file or directory in /makeconfig.php on line 39

Could not write configuration file to /var/www/html/app/config/local.php, you can create this file with the following contents:

<?php
$parameters = array (
  'db_driver' => 'pdo_mysql',
  'install_source' => 'Docker',
  'db_port' => '3306',
  'db_host' => '127.0.0.1',
  'db_name' => 'mautic',
  'db_user' => 'holamundo',
  'db_password' => 'pass',
);```

Also I dont know why the unused variable `MYSQL_PORT_3306_TCP` apears in `docker-entrypoint.sh`

<bountysource-plugin>

---
Want to back this issue? **[Post a bounty on it!](https://app.bountysource.com/issues/78615814-errors-building-beta-fpm-docker-images?utm_campaign=plugin&utm_content=tracker%2F20392502&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://app.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F20392502&utm_medium=issues&utm_source=github).
</bountysource-plugin>
tomingoglia commented 5 years ago

@RafaelAybar I'm editing my previous post. It appears as if the last edit to docker-entrypoint-sh broke the logic. Line 76 checks to see if two files exists and if they don't, it copies in the mautic files to the web root. That new logic is broken and it doesn't copy the files as required on a new installation. If you replace line 76 with the code below, the installation will succeed.

if ! [[ -e index.php && -e app/AppKernel.php ]]; then

I think I'm still having some permissions problems after the file copy. I don't have the volume mapped and perhaps that is causing the problem. On the last step of the configuration I get an error.

One more update and I've got this running in my Kubernetes environment. I had to run the following command before going through the installation steps or I got an error on the screen where you enter the admin login information.

app/console cache:warmup --env=prod

mikob commented 5 years ago

@tomingoglia I have the volume mapped but still get the permission issues. I see the owner of the directory in /var/lib/docker/volumes is www-data on my host at least. How did you fix the permissions issue?

tomingoglia commented 5 years ago

@mikob, I may have done a chmod to 777 before I tried the cache warmup. I'm still researching what the right permissions should be for production. Pretty much hit it with a hammer at this point.

RafaelAybar commented 5 years ago

@tomingoglia I will take a look later, I am busy with other projects, but i will try this fix as soon as a I can. Thanks!