Self Hosted Debian Docker install fail

Version 5.12.44-d

Environment: Docker

Describe the bug

I’m trying to test invoice ninja with a local test environment, nothing fancy.
When following the steps given to set up the debian docker container on github i.e.:git clone https://github.com/invoiceninja/dockerfiles.git -b debian cd dockerfiles/debian

then running docker run --rm -it invoiceninja/invoiceninja-debian php artisan key:generate --show to get the key to put in the .env file. keeping everything else default (all for test purposes so not an issue) only changing the docker compose file to be ‘8030:80’ instead of 80:80 because 80 was already being used.

Then ran sudo docker compose up -d, I get:

 Container debian-app-1 Error dependency app failed to start

and

dependency failed to start: container debian-app-1 is unhealthy

I cannot access the page after that only showing unable to connect (trying to access the site using ip:port from a separate computer on the network as the host of the container is a headless server) and the app logs (through docker compose logs app) don’t show any errors, just some migration/database normal logs then

app-1  | 2026-01-03 01:56:01,079 INFO Included extra file "/etc/supervisor/conf.d/supervisord.conf" during parsing
app-1  | 2026-01-03 01:56:01,080 INFO Set uid to user 0 succeeded
app-1  | 2026-01-03 01:56:01,149 INFO RPC interface 'supervisor' initialized
app-1  | 2026-01-03 01:56:01,150 CRIT Server 'unix_http_server' running without any HTTP authentication checking
app-1  | 2026-01-03 01:56:01,152 INFO supervisord started with pid 1
app-1  | 2026-01-03 01:56:02,161 INFO spawned: 'php-fpm' with pid 1688
app-1  | 2026-01-03 01:56:02,172 INFO spawned: 'queue-worker_00' with pid 1689
app-1  | 2026-01-03 01:56:02,182 INFO spawned: 'queue-worker_01' with pid 1690
app-1  | 2026-01-03 01:56:02,193 INFO spawned: 'scheduler' with pid 1691
app-1  | 2026-01-03 01:56:03,198 INFO success: php-fpm entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
app-1  | 2026-01-03 01:56:03,202 INFO success: queue-worker_00 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
app-1  | 2026-01-03 01:56:03,206 INFO success: queue-worker_01 entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
app-1  | 2026-01-03 01:56:03,208 INFO success: scheduler entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
app-1  | [03-Jan-2026 01:56:53] NOTICE: fpm is running, pid 1688
app-1  | [03-Jan-2026 01:56:53] NOTICE: ready to handle connections
app-1  | 
app-1  |    INFO  Running scheduled tasks.  
app-1  | 
app-1  | 127.0.0.1 -  03/Jan/2026:01:57:24 +0000 "GET " 200
app-1  |    INFO  No scheduled commands are ready to run.  
app-1  | 

running docker compose ps shows:

NAME             IMAGE                                     COMMAND                  SERVICE   CREATED         STATUS                   PORTS
debian-app-1     invoiceninja/invoiceninja-debian:latest   "/usr/local/bin/init…"   app       9 minutes ago   Up 8 minutes (healthy)   9000/tcp
debian-mysql-1   mysql:8                                   "docker-entrypoint.s…"   mysql     9 minutes ago   Up 9 minutes (healthy)   3306/tcp, 33060/tcp
debian-redis-1   redis:alpine                              "docker-entrypoint.s…"   redis     9 minutes ago   Up 9 minutes (healthy)   6379/tcp

I do believe that there is the nginx container(??? beginner at docker so not sure what it is called) missing. Not sure what to do from here. Below are the .env and compose files contents. Thank you for the help in advance.

docker compose file

services:
  app:
    build:
      context: .
    image: invoiceninja/invoiceninja-debian:${TAG:-latest}
    restart: unless-stopped
    env_file:
      - ./.env
    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
      - app_public:/var/www/html/public
      - app_storage:/var/www/html/storage
    depends_on:
      mysql:
        condition: service_healthy
      redis:
        condition: service_healthy

  nginx:
    image: nginx:alpine
    restart: unless-stopped
    ports:
      - "8030:80"
    volumes:
      - ./nginx:/etc/nginx/conf.d:ro
      - app_public:/var/www/html/public:ro
      - app_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:
      - 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:
      - redis_data:/data
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]

volumes:
  app_public:
    driver: local
  app_storage:
    driver: local
  mysql_data:
    driver: local
  redis_data:
    driver: local

.env file:

# IN application vars
APP_URL=http://localhost:8012
APP_KEY=base64:eCOLnRuNmGYXkotWI60VxUvpjTrdxM03bURldnrRZRU=
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=ninja
DB_ROOT_PASSWORD=ninjaAdm1nPassword
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=ninjaAdm1nPassword
MYSQL_USER=ninja
MYSQL_PASSWORD=ninja
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

Hi,

Sorry I’m not sure, it obviously should just work. I suggest creating an issue on the docker repo to ask.

I believe this was linked to pull request #849. I’ll try use this build instead and see if that resolves the issue.

A bit late, I decided to come back to setting this up.

Turns out it was probably due to a slow hardware (I was using a slow VM to test) causing the running of the debian-app container to come out as unhealthy. It eventually becomes healthy however since it shows as unhealthly first, the nginx container doesn’t start due to the dependency on the app starting healthy and even if you manually start it up it won’t run according the docker-compose. To anyone who faces this, all you need to do is remove the dependency in the docker-compose file on the nginx section:

  nginx:
    image: nginx:alpine
    restart: unless-stopped
    ports:
      - "80:80"
    volumes:
      - ./nginx:/etc/nginx/conf.d:ro
      - app_public:/var/www/html/public:ro
      - app_storage:/var/www/html/storage:ro
1 Like

Glad to hear it, thanks for sharing the solution!