Hi everyone,
I’m trying to set up a self-hosted Invoice Ninja instance on Ubuntu using Docker. I cloned both dockerfiles/debian and invoiceninja the repository and structured my files as follows:
invoiceninja/nginx
invoiceninja/php
invoiceninja/scripts
invoiceninja/supervisor
invoiceninja/Dockerfile
invoiceninja/docker-compose.yml
invoiceninja/app
invoiceninja/bootstrap
invoiceninja/config
invoiceninja/database
// Other Invoice Ninja files and folders
I made modifications to docker-compose.yml
, Dockerfile
, and nginx/laravel.conf
as needed. The build completes successfully, but after creating an account, the application shows a white screen (as seen in this video).
here is what I modified
Dockerfile
# Copy local Invoice Ninja code
COPY . /var/www/html
# PHP modules (ensure these include all required extensions)
ARG php_require="bcmath gd mbstring pdo_mysql zip"
ARG php_suggest="exif imagick intl pcntl soap saxon-12.5.0"
ARG php_extra="opcache"
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
mariadb-client \
gpg \
supervisor \
fonts-noto-cjk-extra \
fonts-wqy-microhei \
fonts-wqy-zenhei \
xfonts-wqy \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install PHP extensions (this includes zip, bcmath, gd)
COPY --from=ghcr.io/mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions \
${php_require} \
${php_suggest} \
${php_extra}
# Install Composer
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Install dependencies
RUN composer install --no-dev --prefer-dist --optimize-autoloader
# Create symlink for frontend
RUN ln -s /var/www/html/resources/views/react/index.blade.php /var/www/html/public/index.html \
&& php artisan storage:link \
&& mv /var/www/html/public /tmp/public
USER www-data
docker-compose.yml file
services:
app:
build:
context: . # Use local files instead of pulling from a remote image
restart: unless-stopped
env_file:
- ./.env
volumes:
- .:/var/www/html
- app_cache:/var/www/html/bootstrap/cache
- app_public:/var/www/html/public
- app_storage:/var/www/html/storage
laravel.txt
location ~ \.php$ {
fastcgi_pass invoiceninja-app-1:9000;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
include fastcgi_params;
}
.env file
DB_HOST="invoiceninja-mysql-1"
DB_DATABASE="ninja"
DB_USERNAME="ninja"
DB_PASSWORD="ninja"
DB_PORT="3306"
MYSQL_ROOT_PASSWORD="root"
Could someone please help me troubleshoot this issue? Any guidance would be greatly appreciated!
Thanks in advance!