Errors with the docker-compose.yml

Hi

I cloned the Github repo and modified the docker-compose and the ipconfig.php to my needs. I only changed couple things.

I run the setup with docker-compose up but all I get is a blank page with errors below.

I am wondering if I could get some leads to how to solve this issue.

I am on Debian Testing.

compose file

---
version: "3"

services:

  # --- MariaDB 10.3
  db:
    container_name: "invoiceplane-db"
    image: bitnami/mariadb:10.3
    environment:
      - MARIADB_ROOT_PASSWORD=ipdevdb
      - MARIADB_USER=ipdevdb
      - MARIADB_PASSWORD=PASS
      - MARIADB_DATABASE=ipdevdb
    ports:
      - "3306"
    volumes:
      - /media/DRIVE/invoiceplane/db:/bitnami

  # --- PHP 7.3
  php:
    container_name: "invoiceplane-php"
    image: bitnami/php-fpm:7.3
    depends_on:
      - db
    volumes:
      - .:/app:delegated
      - ./application/docker/php/php-dev.ini:/opt/bitnami/php/etc/conf.d/php.ini:ro

  # --- nginx 1.16
  nginx:
    container_name: "invoiceplane-nginx"
    image: bitnami/nginx:1.16
    ports:
      - "8085:8085"
    depends_on:
      - php
    volumes:
      - .:/app:delegated
      - ./application/docker/nginx/site.conf:/opt/bitnami/nginx/conf/vhosts/site.conf:ro

volumes:
  invoiceplane-db:
    driver: local


invoiceplane-nginx |  23:57:06.68 INFO  ==> Initializing NGINX...                                                                                                                                                  
invoiceplane-nginx |  23:57:06.82 INFO  ==> ** NGINX setup finished! **                                                                                                                                            
invoiceplane-nginx | 
invoiceplane-nginx |  23:57:06.82 INFO  ==> ** Starting NGINX **
invoiceplane-nginx | 2020/04/27 23:57:07 [error] 30#0: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  require(vendor/autoload.php): failed to open stream: No such file or directory in /app/index.php on l
ine 18PHP message: PHP Fatal error:  require(): Failed opening required 'vendor/autoload.php' (include_path='.:/opt/bitnami/php/lib/php') in /app/index.php on line 18" while reading response header from upstream
, client: IP2, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://192.168.16.3:9000", host: "IP:8085"
invoiceplane-nginx | IP2 - - [27/Apr/2020:23:57:07 +0000] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0"
invoiceplane-nginx | 2020/04/27 23:57:10 [error] 30#0: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  require(vendor/autoload.php): failed to open stream: No such file or directory in /app/index.php on l
ine 18PHP message: PHP Fatal error:  require(): Failed opening required 'vendor/autoload.php' (include_path='.:/opt/bitnami/php/lib/php') in /app/index.php on line 18" while reading response header from upstream
, client: IP2, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://192.168.16.3:9000", host: "IP:8085"
invoiceplane-nginx | IP2 - - [27/Apr/2020:23:57:10 +0000] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0"
invoiceplane-nginx | IP2 - - [27/Apr/2020:23:57:18 +0000] "GET / HTTP/1.1" 500 5 "-" "Mozilla/5.0 (X11; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0"
invoiceplane-nginx | 2020/04/27 23:57:18 [error] 30#0: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  require(vendor/autoload.php): failed to open stream: No such file or directory in /app/index.php on l
ine 18PHP message: PHP Fatal error:  require(): Failed opening required 'vendor/autoload.php' (include_path='.:/opt/bitnami/php/lib/php') in /app/index.php on line 18" while reading response header from upstream
, client: IP2, server: _, request: "GET / HTTP/1.1", upstream: "fastcgi://192.168.16.3:9000", host: "IP:8085"
invoiceplane-nginx | 2020/04/27 23:57:19 [error] 30#0: *1 FastCGI sent in stderr: "PHP message: PHP Warning:  require(vendor/autoload.php): failed to open stream: No such file or directory in /app/index.php on l
ine 18PHP message: PHP Fatal error:  require(): Failed opening required 'vendor/autoload.php' (include_path='.:/opt/bitnami/php/lib/php') in /app/index.php on line 18" while reading response header from upstream
, client: IP2, server: _, request: "GET /favicon.ico HTTP/1.1", upstream: "fastcgi://192.168.16.3:9000", host: "IP:8085"


1 Like

Maybe @UnderDog can help you here. I personally do not use Docker.

1 Like

@geritan you are very close to the solution.
You havenā€™t run composer install yet, so it cannot find certain files.

I hope you know how to stop docker-compose when itā€™s running
Also ā€¦ you can keep it running and in another command prompt run composer install
Also ā€¦ since you cloned the repository, please donā€™t forget to run yarn install and yarn run dev.

Cloning repository: run those tools
Downloading .zip: those tools have been run already y

Thanks for your help. That was real progress. I used the zip file.

However I am stuck at Database setup, it says

Failure Cannot connect to the database server with the provided database information. Please check the credentials and try again.

I provide the creds that I added in the docker-compose file.

environment:
      - MARIADB_ROOT_PASSWORD=ipdevdb
      - MARIADB_USER=ipdevdb
      - MARIADB_PASSWORD=PASS
      - MARIADB_DATABASE=ipdevdb

I put ipdevdb as user and PASS for the password with no luck. I put localhost for the database hostname

Any recommendations?

database host name is
db
I seriously hope that in ipconfig.php you used the same information as in your docker-compose file.
During docker-compose up --build the container gets built and the MySQL user should be added.
With docker the MySQL servername is rarely ā€˜localhostā€™
Look at the service in the yml file.
Service is db, so hostname is db

Hi

Yes I have the same settings in both ipconfig and the compose file. However putting db as the host did not help.

I see a message below during the start up.

nvoiceplane-db | mariadb 16:16:20.04                                                                                                                                                                              
invoiceplane-db | mariadb 16:16:20.04 INFO  ==> ** Starting MariaDB setup **                                                                                                                                       
invoiceplane-db | mariadb 16:16:20.09 INFO  ==> Validating settings in MYSQL_*/MARIADB_* env vars                                                                                                                  
invoiceplane-db | mariadb 16:16:20.41 INFO  ==> Initializing mariadb database                                                                                                                                      
invoiceplane-db | mkdir: cannot create directory '/bitnami/mariadb': Permission denied
invoiceplane-db exited with code 1
invoiceplane-nginx |  16:16:31.09 
invoiceplane-nginx |  16:16:31.12 Welcome to the Bitnami nginx container
invoiceplane-nginx |  16:16:31.12 Subscribe to project updates by watching https://github.com/bitnami/bitnami-docker-nginx
invoiceplane-nginx |  16:16:31.12 Submit issues and feature requests at https://github.com/bitnami/

This is curious because it actually creates the ā€œdbā€ folder during start up , so it should not have a permission issue.

For others having the similar issue, this is how I fixed, maybe it is insecure but I will run this locally.

What I did was run it once then chmod 777 the folder and restarted the container then it stopped complaining about the permission issue. Then I was able to setup the instance.

Thanks for your help again.

1 Like

Well done!
Make sure that when you create a database it gets ā€˜persistedā€™. Itā€™s one of the things that belong to docker: when you bring the container down usually everything I it goes down as well.
By persisting data, especially mysql data volumes, you will keep your database after docker is down

Creating bitnami/mariadb was part of persisting the database

Thanks, that was the issue since I was trying to set up an external volume. It should work I see the db in the defined path.

Now I see it. This is your volume: - /media/DRIVE/invoiceplane/db:/bitnami
So after the database is created and filled you can do docker-compose down.
If you do docker-compose up again and the database is still there, then you have the perfect working setup

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.