Hi all,
Trying to set up Invoice Ninja on my QNAP NAS using Container Station which is using Docker.
I have the following YAML code to set up my application (the YAML file is based on the code in the docker-compose file on GitHub):
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
ports:
- "8012:8012"
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
nginx:
image: nginx:alpine
restart: unless-stopped
ports:
- "80:80"
volumes:
- ./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 here is my .env file:
# IN application vars
APP_URL=http://localhost: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
[email protected]
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='[email protected]'
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
Everything starts up fine, but I can’t access the webpage. I keep getting connection refused on port 8012. I’ve tried using http://192.168.0.3:8012 in the .env file instead of localhost as that is the IP address of the NAS.
I’m kinda stumped. It looks like it’s running, I just can’t figure out how to access it…
Thanks,
Jon