OK all,
I’m trying to get another container working here. I want to explore InvoiceNinja for possible use in my business. I’ve got the container and its supporting apps up and running but I can’t access it. I’ve asked for help on the InvoiceNinja forum and they have told me all they know…Still isn’t working. They suggested I ask here. So maybe some of your Compose wizards can help me figure out what I am doing wrong…
Here is my compose file:
services:
app:
build:
context: .
image: invoiceninja/invoiceninja-debian:latest
restart: unless-stopped
env_file:
- /share/Container/invoiceninja/.env
environment:
- PUID=1000
- PGID=1000
- TZ=America/Chicago
volumes:
# - ./php/php.ini:/usr/local/etc/php/conf.d/invoiceninja.ini:ro
# - ./php/php-fpm.conf:/usr/local/etc/php-fpm.d/invoiceninja.conf:ro
# - ./supervisor/supervisord.conf:/etc/supervisor/conf.d/supervisord.conf:ro
- /share/Container/invoiceninja/public:/var/www/html/public
- /share/Container/invoiceninja/storage:/var/www/html/storage
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
nginx:
image: nginx:alpine
restart: unless-stopped
ports:
- "8012:80"
volumes:
- ./share/Container/invoiceninja/nginx:/etc/nginx/conf.d:ro
- /share/Container/invoiceninja/public:/var/www/html/public:ro
- /share/Container/invoiceninja/storage:/var/www/html/storage:ro
depends_on:
app:
condition: service_healthy
mysql:
image: mysql:8
restart: unless-stopped
environment:
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
volumes:
- /share/Container/invoiceninja/mysql_data:/var/lib/mysql
healthcheck:
test:
[
"CMD",
"mysqladmin",
"ping",
"-h",
"localhost",
"-u${MYSQL_USER}",
"-p${MYSQL_PASSWORD}",
]
redis:
image: redis:alpine
restart: unless-stopped
volumes:
- /share/Container/invoiceninja/redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
And since the app uses a .env file, here is that file with redactions:
# IN application vars
APP_URL=http://192.168.0.3:8012
APP_KEY=base64:7some_key_code
APP_ENV=production
APP_DEBUG=true
REQUIRE_HTTPS=false
PHANTOMJS_PDF_GENERATION=false
PDF_GENERATOR=snappdf
TRUSTED_PROXIES='*'
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
REDIS_HOST=redis
REDIS_PASSWORD=null
REDIS_PORT=6379
FILESYSTEM_DISK=debian_docker
# DB connection
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=ninja
DB_USERNAME=ninja
DB_PASSWORD=*******
DB_ROOT_PASSWORD=********
DB_CONNECTION=mysql
# Create initial user
# Default to these values if empty
IN_USER_EMAIL=admin@example.com
IN_PASSWORD=changeme!
# IN_USER_EMAIL=
# IN_PASSWORD=
# Mail options
MAIL_MAILER=log
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS='user@example.com'
MAIL_FROM_NAME='Self Hosted User'
# MySQL
MYSQL_ROOT_PASSWORD=*****
MYSQL_USER=ninja
MYSQL_PASSWORD=*****
MYSQL_DATABASE=ninja
# GoCardless/Nordigen API key for banking integration
NORDIGEN_SECRET_ID=
NORDIGEN_SECRET_KEY=
IS_DOCKER=true
SCOUT_DRIVER=null
#SNAPPDF_CHROMIUM_PATH=/usr/bin/google-chrome-stable
So it starts up but like I said - I can’t access the website. Won’t come up. On the InvoiceNinja forum the user helping me said the following:
3. Check the Nginx Config
You have a volume mapping for Nginx:- ./nginx:/etc/nginx/conf.d:ro.
- Ensure that the configuration file inside that folder is correctly pointing to the
appservice on the internal port (usually 9000 if using FPM, or 8000 if using the web-server variant).- If you are using the standard Invoice Ninja docker-compose example, ensure the
fastcgi_passis set toapp:9000.
So I remapped ./nginx:/etc/nginx/conf.d:ro to ./share/Container/invoiceninja/nginx:/etc/nginx/conf.d:ro
However, that folder is not being created and if I go in and inspect the Nginx container, I see that etc/nginx/conf.d is instead being mapped to /share/ZFS530_DATA/.qpkg/container-station/data/application/invoiceninja/share/Container/invoiceninja/nginx
Why is QNAP not following my instructions and mapping the container to the storage location I requested? I don’t know if that will solve my issue but I’d like to take a look at that config file and have more control over it.
And when I do go to that directory from an SSH shell, there is nothing there. So Nginx has no configuration…
Does anyone else see any possible issue that I have here?