Docker self host latest v5

I’ve been trying to get out of the initial setup page for days, and I can’t. It’s driving me crazy.

[2020-12-01 20:20:54] production.INFO: The command “mysql --user=”${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}" --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --database="${:LARAVEL_LOAD_DATABASE}" < “${:LARAVEL_LOAD_PATH}”" failed.

Exit Code: 1(General error)

Working directory: /var/www/app/public

Output:
================


Error Output:
================
ERROR 1050 (42S01) at line 9: Table 'accounts' already exists

In fact, I got it once, but I deleted the docker-compose and I don’t know what is going wrong for me.

Please help.

version: '3.7'

services:
  server:
    image: nginx
    restart: always
    environment: 
      - APP_URL=https://192.168.100.252
    volumes:
      # Vhost configuration
      - ./config/nginx/in-vhost.conf:/etc/nginx/conf.d/in-vhost.conf:ro

      # Configure your mounted directories, make sure the folder 'public' and 'storage'
      # exist, before mounting them
      #-  public:/var/www/app/public
      #-  storage:/var/www/app/storage
      # you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
      - ./public:/var/www/app/public:rw,delegated
      - ./storage:/var/www/app/storage:rw,delegated
    depends_on:
      - app
    # Run webserver nginx on port 80
    # Feel free to modify depending what port is already occupied
    ports: 
      - "10080:80"
      - "10443:443"
    networks:
      - invoiceninja

  app:
    image: invoiceninja/invoiceninja:5
    restart: always
    cap_add:
      - SYS_ADMIN
    environment: 
      - APP_URL=https://192.168.100.252
      - APP_KEY=base64:569LzoP3jBJHHvB8CnD/R/UuhpDQ7TA0k7amk1FT73c=
      - MULTI_DB_ENABLED=false
      - DB_HOST1=db
      - DB_USERNAME1=ninja
      - DB_PASSWORD1=ninja
      - DB_DATABASE1=ninja
      - PHANTOMJS_PDF_GENERATION=false
    volumes:
      # Configure your mounted directories, make sure the folder 'public' and 'storage'
      # exist, before mounting them
      #-  public:/var/www/app/public
      #-  storage:/var/www/app/storage
      # you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
      - ./public:/var/www/app/public:rw,delegated
      - ./storage:/var/www/app/storage:rw,delegated
    depends_on:
      - db
    networks: 
      - invoiceninja  

  db:
    image: mysql:5
    restart: always
    environment: 
      - MYSQL_ROOT_PASSWORD=ninjaAdm1nPassword
      - MYSQL_USER=ninja
      - MYSQL_PASSWORD=ninja
      - MYSQL_DATABASE=ninja
    volumes:
      - mysql-data:/var/lib/mysql:rw
      # you may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
      # - ./docker/mysql/data:/var/lib/mysql:rw,delegated
    networks:
      - invoiceninja

  # THIS IS ONLY A VALID CONFIGURATION FOR IN 4. DO NOT USE FOR IN 5.
  # cron:
  #   image: invoiceninja/invoiceninja:alpine-4
  #   volumes:
  #     -  storage:/var/www/app/storage
  #     -  logo:/var/www/app/public/logo
  #     -  public:/var/www/app/public
  #   entrypoint: |
  #     /bin/sh -c 'sh -s <<EOF
  #     trap "break;exit" SIGHUP SIGINT SIGTERM
  #     sleep 300s
  #     while /bin/true; do
  #       ./artisan ninja:send-invoices
  #       ./artisan ninja:send-reminders
  #       sleep 1d
  #     done
  #     EOF'
  #   networks:
  #     - invoiceninja

volumes:
  mysql-data:
  public:
  storage:
  # This is needed for letting th cron run correctly
  # logo:

networks:
  invoiceninja:

Hi,

Are you using the official dockerfile?

Yes of course. In fact, I made it work. But for whatever reason, with the latest version, on my last try, I lost something and I don’t know what happens. The 3 services in docker I see them raised (db, server, ngnix). When I access the web, the SETUP appears, but no matter how hard I try to change things, I always get the same SETUP over and over again.

I’m using by now, and for two years ago, white label v4 self host.

My intention is migrate to v5.

Any help is appreciated.

do you see anything in the logs?

docker-compose logs -f

Thanks David and Hillel for your help.

$ sudo docker-compose logs -f
Attaching to ninja5_server_1, ninja5_app_1, ninja5_db_1
app_1     | WARNING: no logs are available with the 'db' log driver
db_1      | WARNING: no logs are available with the 'db' log driver
server_1  | WARNING: no logs are available with the 'db' log driver

And laravel.log:

[2020-12-03 09:11:59] production.DEBUG: Message-ID: <5771a432a0e9ba629945a161220892c1@_>
Date: Thu, 03 Dec 2020 09:11:59 +0000
Subject: Email
From: ***@***.com
To: ***@***.com
MIME-Version: 1.0
Content-Type: multipart/alternative;
 boundary="_=_swift_1606986719_857612b90a9b784763cf18d157343fad_=_"

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="box-sizing: border-box; border: 0 solid #d2d6dc; -webkit-text-size-adjust: 100%; font-family: Open Sans,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji; line-height: 1.5;">
<head style="box-sizing: border-box; border: 0 solid #d2d6dc;">
<meta name="viewport" content="width=device-width, initial-scale=1.0" style="box-sizing: border-box; border: 0 solid #d2d6dc;">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" style="box-sizing: border-box; border: 0 solid #d2d6dc;">
</head>
<body style="border: 0 solid #d2d6dc; font-family: Avenir, Helvetica, sans-serif; box-sizing: border-box; background-color: #f5f8fa; color: #74787E; height: 100%; hyphens: auto; line-height: 1.4; margin: 0; -moz-hyphens: auto; -ms-word-break: break-all; width: 100% !important; -webkit-hyphens: auto; -webkit-text-size-adjust: none; word-break: break-word;">
<style style="box-sizing: border-box; border: 0 solid #d2d6dc;">
@media  only screen and (max-width: 600px) {
.inner-body {
width: 100% !important;
}

.footer {
width: 100% !important;
}
}

@media  only screen and (max-width: 500px) {
.button {
width: 100% !important;
}
}
</style>

<table class="wrapper" width="100%" cellpadding="0" cellspacing="0" style="border: 0 solid #d2d6dc; border-collapse: collapse; font-family: Avenir, Helvetica, sans-serif; box-sizing: border-box; background-color: #f5f8fa; margin: 0; padding: 0; width: 100%; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 100%;">
<tr style="box-sizing: border-box; border: 0 solid #d2d6dc;">
<td align="center" style="border: 0 solid #d2d6dc; font-family: Avenir, Helvetica, sans-serif; box-sizing: border-box;">
<table class="content" width="100%" cellpadding="0" cellspacing="0" style="border: 0 solid #d2d6dc; border-collapse: collapse; font-family: Avenir, Helvetica, sans-serif; box-sizing: border-box; margin: 0; padding: 0; width: 100%; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 100%;">


<!-- Email Body -->
<tr style="box-sizing: border-box; border: 0 solid #d2d6dc;">
<td class="body" width="100%" cellpadding="0" cellspacing="0" style="border: 0 solid #d2d6dc; font-family: Avenir, Helvetica, sans-serif; box-sizing: border-box; background-color: #FFFFFF; border-bottom: 1px solid #EDEFF2; border-top: 1px solid #EDEFF2; margin: 0; padding: 0; width: 100%; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 100%;">
<table class="inner-body" align="center" width="570" cellpadding="0" cellspacing="0" style="border: 0 solid #d2d6dc; border-collapse: collapse; font-family: Avenir, Helvetica, sans-serif; box-sizing: border-box; background-color: #FFFFFF; margin: 0 auto; padding: 0; width: 570px; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 570px;">
<!-- Body content -->
<tr style="box-sizing: border-box; border: 0 solid #d2d6dc;">
<td class="content-cell" style="border: 0 solid #d2d6dc; font-family: Avenir, Helvetica, sans-serif; box-sizing: border-box; padding: 35px;">
<p style="border: 0 solid #d2d6dc; margin: 0; font-family: Avenir, Helvetica, sans-serif; box-sizing: border-box; color: #74787E; font-size: 16px; line-height: 1.5em; margin-top: 0; text-align: left;">Email Server Works!</p>



</td>
</tr>
</table>
</td>
</tr>

<tr style="box-sizing: border-box; border: 0 solid #d2d6dc;">
<td style="border: 0 solid #d2d6dc; font-family: Avenir, Helvetica, sans-serif; box-sizing: border-box;">
<table class="footer" align="center" width="570" cellpadding="0" cellspacing="0" style="border: 0 solid #d2d6dc; border-collapse: collapse; font-family: Avenir, Helvetica, sans-serif; box-sizing: border-box; margin: 0 auto; padding: 0; text-align: center; width: 570px; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 570px;">
<tr style="box-sizing: border-box; border: 0 solid #d2d6dc;">
<td class="content-cell" align="center" style="border: 0 solid #d2d6dc; font-family: Avenir, Helvetica, sans-serif; box-sizing: border-box; padding: 35px;">
<p style="border: 0 solid #d2d6dc; margin: 0; font-family: Avenir, Helvetica, sans-serif; box-sizing: border-box; line-height: 1.5em; margin-top: 0; color: #AEAEAE; font-size: 12px; text-align: center;">© 2020 Invoice Ninja.</p>

</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>

Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

[Header Title](https://192.168.100.252)

Email Server Works!

© 2020 Invoice Ninja.
  
[2020-12-03 09:12:04] production.INFO: The command "mysql  --user="${:LARAVEL_LOAD_USER}" --password="${:LARAVEL_LOAD_PASSWORD}" --host="${:LARAVEL_LOAD_HOST}" --port="${:LARAVEL_LOAD_PORT}" --database="${:LARAVEL_LOAD_DATABASE}" < "${:LARAVEL_LOAD_PATH}"" failed.

Exit Code: 1(General error)

Working directory: /var/www/app/public

Output:
================


Error Output:
================
ERROR 1050 (42S01) at line 9: Table 'accounts' already exists

I’m not sure what to suggest.

The only thing that comes to mind is wiping all the images and mount points and starting completely fresh.

Thanks, i’ll try and comment results…

Done and working by now. I made a fresh install. Now, l’ll try to migrate to v5 my data from v4 whitelabel.

If i have made a custom template for invoices in v4, will be a problem for the process of migration?

Thanks again for all.

Hey there!

Glad you made it work. Unfortunately, designs from v4 aren’t supported in v5, but making them like in v4 should be easy if you’re familliar with HTML & CSS. :+1:

1 Like