I am pulling my hair out. I am trying to self host InvoiceNinja in Docker and it starts to work, but after a while I get blank screens. The Docker host is running Ubuntu 24.
I am using the latest of everything. This is my current setup:
===
compose.yml:
---
networks:
internal:
driver: bridge
traefik:
external: true
x-app-common: &a1
image: invoiceninja/invoiceninja-octane:latest
restart: unless-stopped
env_file:
- ./.env
volumes:
- ./.env:/app/.env
- /srv/invoiceninja/app/storage:/app/storage
- /srv/invoiceninja/app/public:/app/public
networks:
- internal
services:
db:
image: mariadb:10.5
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${DB_ROOT_PASSWORD}
MYSQL_DATABASE: ${DB_DATABASE}
MYSQL_USER: ${DB_USERNAME}
MYSQL_PASSWORD: ${DB_PASSWORD}
healthcheck:
test:
- CMD-SHELL
- mysqladmin ping -h localhost -u$DB_USERNAME -p$DB_PASSWORD
interval: 10s
timeout: 5s
retries: 5
start_period: 15s
volumes:
- /srv/invoiceninja/mariadb:/var/lib/mysql
networks:
- internal
redis:
image: redis:7-alpine
restart: unless-stopped
command:
- redis-server
- --requirepass
- ${REDIS_PASSWORD}
healthcheck:
test:
- CMD-SHELL
- redis-cli -a $REDIS_PASSWORD ping
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
volumes:
- /srv/invoiceninja/redis:/data
networks:
- internal
app:
<<: *a1
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
command:
- --port=80
- --host=0.0.0.0
- --workers=2
environment:
LARAVEL_ROLE: app
labels:
- traefik.enable=true
- traefik.http.routers.invoiceninja.rule=Host(`anonimized.myhost.nl`)
- traefik.http.routers.invoiceninja.entrypoints=websecure
- traefik.http.routers.invoiceninja.tls=true
- traefik.http.routers.invoiceninja.tls.certresolver=letsencrypt
# HTTP router and redirect middleware removed - HTTPS only
- traefik.http.services.invoiceninja.loadbalancer.server.port=80
- traefik.http.services.invoiceninja.loadbalancer.server.scheme=http
networks:
- traefik
- internal
worker:
<<: *a1
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
app:
condition: service_healthy
command: --verbose --sleep=3 --tries=3 --max-time=3600
environment:
LARAVEL_ROLE: worker
healthcheck:
test:
- CMD
- pgrep
- -f
- queue:work
start_period: 10s
scheduler:
<<: *a1
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
app:
condition: service_healthy
command: --verbose
environment:
LARAVEL_ROLE: scheduler
healthcheck:
test:
- CMD
- pgrep
- -f
- schedule:work
start_period: 10s
x-dockge:
urls:
- https://anonimized.myhost.nl/
===
.env
---
APP_ENV=production
# Invoice Ninja .env
APP_URL=https://anonimized.myhost.nl
APP_KEY=9iCJq600sP1O1GqN7gBi5Iu4PqrcXc49
APP_DEBUG=false
EXPANDED_LOGGING=true
REQUIRE_HTTPS=false
IS_DOCKER=true
CACHE_DRIVER=redis
QUEUE_CONNECTION=redis
SESSION_DRIVER=redis
TRUSTED_PROXIES=*
# Database settings
DB_HOST=db
DB_DATABASE=ninjadb
DB_USERNAME=ninjauser
DB_PASSWORD=invoiceninja_secure_password
DB_ROOT_PASSWORD=mysql_root_secure_password
# Redis settings
REDIS_HOST=redis
REDIS_PASSWORD=redis_secure_password
# Admin / initial Invoice Ninja account
[email protected]
IN_PASSWORD=supersecret
# Queue & scheduler
QUEUE_CONNECTION=redis
SCHEDULER_ENABLED=true
# Preconfigure install (skip setup wizard)
PRECONFIGURED_INSTALL=true
# Other optional settings
MULTI_DB_ENABLED=false
====
At first it works, but after a while clicking on a function, e.g Clients, it’ll end up with a white screen in the browser. And I see a few javascripts being blocked by the message:
was blocked because of a disallowed MIME type (“text/html”).
I hope someone can help me!