invoiceninja / dockerfiles

Docker files for Invoice Ninja
https://hub.docker.com/r/invoiceninja/invoiceninja
GNU General Public License v2.0
420 stars 268 forks source link

Installation for InvoiceNinja 4.5 #505

Closed horschdel closed 1 day ago

horschdel commented 1 year ago

Hi, I have been trying to install Invoiceninja 4.5 in a Docker container (using Docker-Compose as well as Portainer Stacks) on a raspberry pi 4 B for a couple of days now, with no success.

I would like to manage all the files in my home directory, so /home/myuser/invoiceninja.

The file structure is as follows (I also chown 1000:1000 the invoiceninja directory):

invoiceninja

The docker files looks like this:

version: '3.7'

services:
  server:
    image: nginx
    restart: always
    user: "1000"
    volumes:
      # Vhost configuration
      #- ./config/caddy/Caddyfile:/etc/caddy/Caddyfiledocker-com
      - /home/myuser/invoiceninja/config/nginx.conf:/etc/nginx/conf.d/in-vhost.conf:ro
      - /home/myuser/invoiceninja/data/public:/var/www/app/public:ro
    depends_on:
      - app
    # Run webserver nginx on port 80
    # Feel free to modify depending what port is already occupied
    ports:
      - "7000:80"
      - "7100:443"
    networks:
      - invoiceninja
    extra_hosts:
      - "in5.localhost:192.168.1.225 " #host and ip

  app:
    image: invoiceninja/invoiceninja:4.5
    restart: always
    user: "1000"
    volumes:
      - /home/myuser/invoiceninja/config/hosts:/etc/hosts:ro
      - /home/myuser/invoiceninja/data/public:/var/www/app/public:rw,delegated
      - /home/myuser/invoiceninja/data/storage:/var/www/app/storage:rw,delegated
    depends_on:
      - db
    networks:
      - invoiceninja
    extra_hosts:
      - "in5.localhost:192.168.1.225" #host and ip

  db:
    image: mariadb:10.4
    user: "1000"
    ports:
      - "3305:3306"
    restart: always
    volumes:
      - /home/myuser/invoiceninja/mysql:/var/lib/mysql:rw,delegated
    networks:
      - invoiceninja
    extra_hosts:
      - "in5.localhost:192.168.1.225 " #host and ip

networks:
  invoiceninja:

The .env file looks like this:

APP_URL=http://192.168.1.225:7000
APP_KEY=base64:XXX (I removed the key)
APP_DEBUG=true
REQUIRE_HTTPS=false
PHANTOMJS_PDF_GENERATION=false
PDF_GENERATOR=snappdf
QUEUE_CONNECTION=database
DB_HOST=db
DB_PORT=3306
DB_DATABASE=ninja
DB_USERNAME=ninja
DB_PASSWORD=ninja
IN_USER_EMAIL=mail@mail.de
IN_PASSWORD=password
MAIL_MAILER=log
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=mail@mail.de
MAIL_FROM_NAME=MyName
MYSQL_ROOT_PASSWORD=ninjaAdm1nPassword
MYSQL_USER=ninja
MYSQL_PASSWORD=ninja
MYSQL_DATABASE=ninja
DB_STRICT=false
APP_CIPHER=AES-256-CBC

The Hosts file:

192.168.1.225 in5.localhost

The Nginx.conf file:

server {
    listen 80 default_server;
    server_name _;

    client_max_body_size 100M;

    root /var/www/app/public/;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass app:9000;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }
}

Anyone any ideas what might be the issue?

When I deploy the stack it also shows the Port number for a few seconds before that disappears. The site however is never reachable.

Also, the folders on the drive appear completely empty.

horschdel commented 1 year ago

No one?

adrinux commented 1 year ago

I suspect this is because the latest version (4.5.50) doesn't work in Docker due to php 7.4 being a requirement - there are several issues discussing this if you search. Try reducing the version to 4.5.45. (You specify 4.5 which will install the latest version available.)