Git Product home page Git Product logo

dockerfiles's Introduction

Sublime's custom image

v5-develop phpunit Codacy Badge CLA assistant

Invoice Ninja 5

Join us on Slack, Discord, Support Forum

Introduction

Version 5 of Invoice Ninja is here! We took the best parts of version 4 and add the most requested features to produce a invoicing application like no other.

All Pro and Enterprise features from the hosted app are included in the open code. We offer a $30 per year white-label license to remove the Invoice Ninja branding from client facing parts of the app.

Setup

Mobile Apps

Desktop Apps

Installation Options

Recommended Providers

Quick Hosting Setup

git clone --single-branch --branch v5-stable https://github.com/invoiceninja/invoiceninja.git
cp .env.example .env
composer i -o --no-dev
php artisan key:generate

Please Note: Your APP_KEY in the .env file is used to encrypt data, if you lose this you will not be able to run the application.

Run if you want to load sample data, remember to configure .env

php artisan migrate:fresh --seed && php artisan db:seed && php artisan ninja:create-test-data

To run the web server

php artisan serve 

Navigate to (replace localhost with the appropriate domain)

http://localhost:8000/setup - To setup your configuration if you did not load sample data.
http://localhost:8000/ - For Administrator Logon

user: [email protected]
pass: password

http://localhost:8000/client/login - For Client Portal

user: [email protected]
pass: password

Developers Guide

App Design

The API and client portal have been developed using Laravel if you wish to contribute to this project familiarity with Laravel is essential.

When inspecting functionality of the API, the best place to start would be in the routes/api.php file which describes all of the availabe API endpoints. The controller methods then describe all the entry points into each domain of the application, ie InvoiceController / QuoteController

The average API request follows this path into the application.

  • Middleware processes the request initially inspecting the domain being requested + provides the authentication layer.
  • The request then passes into a Form Request (Type hinted in the controller methods) which is used to provide authorization and also validation of the request. If successful, the request is then passed into the controller method where it is digested, here is an example:
public function store(StoreInvoiceRequest $request)
{

    $invoice = $this->invoice_repo->save($request->all(), InvoiceFactory::create(auth()->user()->company()->id, auth()->user()->id));

    $invoice = $invoice->service()
                        ->fillDefaults()
                        ->triggeredActions($request)
                        ->adjustInventory()
                        ->save();

    event(new InvoiceWasCreated($invoice, $invoice->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));

    return $this->itemResponse($invoice);

}

Here for example we are storing a new invoice, we pass the validated request along with a factory into the invoice repository where it is processed and saved.

The returned invoice then passes through its service class (app/Services/Invoice) where various actions are performed.

A event is then fired which notifies listeners in the application (app/Providers/EventServiceProvider) which perform non blocking sub tasks

Finally the invoice is transformed (app/Transformers/) and returned as a response via Fractal.

Developer environment

Using the Quick Hosting Setup describe above you can quickly get started building out your development environment. Instead of using

composer i -o --no-dev

use

composer i -o

This provides the developer tools including phpunit which allows the test suite to be run.

If you are considering contributing back to the main repository, please add in any tests for new functionality / modifications. This will greatly increase the chances of your PR being accepted

Also, if you plan any additions for the main repository, you may want to discuss this with us first on Slack where we can assist with any technical information and provide advice.

Credits

Security

If you find a security issue with this application, please send an email to [email protected]. Please follow responsible disclosure procedures if you detect an issue. For further information on responsible disclosure please read here.

License

Invoice Ninja is released under the Elastic License.
See LICENSE for details.

dockerfiles's People

Contributors

anojht avatar arubacao avatar ax2bboud avatar beganovich avatar beremaran avatar cinemast avatar codedge avatar danielgroen avatar djmaze avatar ffaen avatar fwdit avatar hashdot avatar hillelcoren avatar julianengel avatar justintime50 avatar lalop avatar lwj5 avatar patski123 avatar pierreozoux avatar psycho0verload avatar robingchan avatar s-gerber avatar schroedt avatar sleeyax avatar tacticz avatar tms0 avatar turbo124 avatar veselahouba avatar xenion1987 avatar yinshanyang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dockerfiles's Issues

APP_CIPHER is set to an invalid default value

Similar to others, I've run into a problem where the APP_CIPHER is set to an invalid default value. The Dockerfile sets it to "rijndael-128", when the only valid options are "AES-128-CBC" and "AES-256-CBC".

While it's true the front page documentation says this value should be overridden, it's better to have it fail gracefully when no value is specified. The existing value should be removed from the Dockerfile, or a valid cipher should be put in its place, or the build should be made to fail when no cipher is specified.

Web Server does not start

Hi,

I tried the dockerfile on an Ubuntu 14.04 virtual machine with Docker 1.12 and Docker-Compose 1.8.1

The containers are started (docker ps) but it seems the webserver does not come up as no process listens on port 80 (netstat -tulpn) or any other port.

The startup log of docker-compose:

Attaching to exemple_db_1, exemple_cron_1, exemple_app_1, exemple_web_1 ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.527466Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.531551Z 0 [Note] mysqld (mysqld 5.7.16) starting as process 1 ... ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.537795Z 0 [Note] InnoDB: PUNCH HOLE support available ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.538787Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.538813Z 0 [Note] InnoDB: Uses event mutexes ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.538830Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.538840Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.3 ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.538849Z 0 [Note] InnoDB: Using Linux native AIO ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.540094Z 0 [Note] InnoDB: Number of pools: 1 ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.540224Z 0 [Note] InnoDB: Using CPU crc32 instructions ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.541678Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.555507Z 0 [Note] InnoDB: Completed initialization of buffer pool ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.559945Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.577244Z 0 [Note] InnoDB: Highest supported file format is Barracuda. ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.578641Z 0 [Note] InnoDB: Log scan progressed past the checkpoint lsn 12137730 ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.582097Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 12137739 ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.582431Z 0 [Note] InnoDB: Doing recovery: scanned up to log sequence number 12137739 ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.582873Z 0 [Note] InnoDB: Database was not shutdown normally! ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.582899Z 0 [Note] InnoDB: Starting crash recovery. ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.703678Z 0 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1" ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.705344Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.705496Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.841473Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.842364Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.842372Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.842604Z 0 [Note] InnoDB: Waiting for purge to start ^[[32mapp_1 |^[[0m MySQL Connection Error: SQLSTATE[HY000] [2002] Connection refused ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.892775Z 0 [Note] InnoDB: 5.7.16 started; log sequence number 12137739 ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.893098Z 0 [Note] Plugin 'FEDERATED' is disabled. ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.896920Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.898799Z 0 [Note] InnoDB: Buffer pool(s) load completed at 161028 14:00:23 ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.899598Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.900180Z 0 [Note] Server hostname (bind-address): '*'; port: 3306 ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.900452Z 0 [Note] IPv6 is available. ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.900513Z 0 [Note] - '::' resolves to '::'; ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.900751Z 0 [Note] Server socket created on IP: '::'. ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.905302Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.905377Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.907566Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.913565Z 0 [Note] Event Scheduler: Loaded 0 events ^[[36mdb_1 |^[[0m 2016-10-28T14:00:23.913899Z 0 [Note] mysqld: ready for connections. ^[[36mdb_1 |^[[0m Version: '5.7.16' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL) ^[[32mapp_1 |^[[0m MySQL ready ^[[32mapp_1 |^[[0m start ^[[32mapp_1 |^[[0m [28-Oct-2016 14:00:26] NOTICE: fpm is running, pid 1 ^[[32mapp_1 |^[[0m [28-Oct-2016 14:00:26] NOTICE: ready to handle connections

Any help is much appreciated.

Cheers

Update issues

I see data migration is commented out: https://github.com/invoiceninja/dockerfiles/blob/master/entrypoint.sh#L34

Is it done anywhere else? If not, I propose the following added to the docker-compose.yml file,

  migration:
    image: invoiceninja/invoiceninja
    links:
      - db:mysql
    env_file: .env
    volumes_from:
      - app
    entrypoint: /usr/local/bin/php /var/www/app/artisan migrate --force

I was trying to update from an older version. I was redirected to https://billing.xxxxxxxx.xxxxxxxx/update and got the following exception,

1/1
ErrorException in HandleUserLoggedIn.php line 72:
Trying to get property of non-object

in HandleUserLoggedIn.php line 72
at HandleExceptions->handleError('8', 'Trying to get property of non-object', '/var/www/app/app/Listeners/HandleUserLoggedIn.php', '72', array('event' => object(UserLoggedIn), 'account' => object(Account), 'users' => false, 'accountGateway' => false)) in HandleUserLoggedIn.php line 72
at HandleUserLoggedIn->handle(object(UserLoggedIn))
at call_user_func_array(array(object(HandleUserLoggedIn), 'handle'), array(object(UserLoggedIn))) in compiled.php line 10247
at Dispatcher->Illuminate\Events\{closure}(object(UserLoggedIn))
at call_user_func_array(object(Closure), array(object(UserLoggedIn))) in compiled.php line 10192
at Dispatcher->fire('App\Events\UserLoggedIn') in compiled.php line 6383
at Facade::__callStatic('fire', array(object(UserLoggedIn))) in StartupCheck.php line 125
at StartupCheck->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartupCheck), 'handle'), array(object(Request), object(Closure))) in compiled.php line 10021
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in QueryLogging.php line 32
at QueryLogging->handle(object(Request), object(Closure))
at call_user_func_array(array(object(QueryLogging), 'handle'), array(object(Request), object(Closure))) in compiled.php line 10021
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in DuplicateSubmissionCheck.php line 39
at DuplicateSubmissionCheck->handle(object(Request), object(Closure))
at call_user_func_array(array(object(DuplicateSubmissionCheck), 'handle'), array(object(Request), object(Closure))) in compiled.php line 10021
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 3225
at VerifyCsrfToken->handle(object(Request), object(Closure)) in VerifyCsrfToken.php line 44
at VerifyCsrfToken->handle(object(Request), object(Closure))
at call_user_func_array(array(object(VerifyCsrfToken), 'handle'), array(object(Request), object(Closure))) in compiled.php line 10021
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 13532
at ShareErrorsFromSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(ShareErrorsFromSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 10021
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 12022
at StartSession->handle(object(Request), object(Closure))
at call_user_func_array(array(object(StartSession), 'handle'), array(object(Request), object(Closure))) in compiled.php line 10021
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 13271
at AddQueuedCookiesToResponse->handle(object(Request), object(Closure))
at call_user_func_array(array(object(AddQueuedCookiesToResponse), 'handle'), array(object(Request), object(Closure))) in compiled.php line 10021
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 13208
at EncryptCookies->handle(object(Request), object(Closure))
at call_user_func_array(array(object(EncryptCookies), 'handle'), array(object(Request), object(Closure))) in compiled.php line 10021
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 3286
at CheckForMaintenanceMode->handle(object(Request), object(Closure))
at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in compiled.php line 10021
at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
at Pipeline->Illuminate\Routing\{closure}(object(Request))
at call_user_func(object(Closure), object(Request)) in compiled.php line 10006
at Pipeline->then(object(Closure)) in compiled.php line 2366
at Kernel->sendRequestThroughRouter(object(Request)) in compiled.php line 2350
at Kernel->handle(object(Request)) in index.php line 51

I was logged in before. So, I opened a new private window and accessed https://billing.xxxxxxxx.xxxxxxxx/update again. This time it took a while but took me to the log in page with the message Successfully completed update - See what's new in v3.2.0.

Testing db connection in app-entrypoint.sh

I want to open the discussion:

why is the db testing mechanism necessary?

AFAIK It is not the responsibility of the container to check the db connection. Instead the application itself should verify if there is a working db connection. This simplifies the app-entrypoint.sh and loses the inaccurate try wait mechanism.

Bypass setup

is there anyway to "bypass" the "setup" process when using self hosted docker file installation? Seems that setup would keep overwriting stuff that "undos" my initial docker setup

Issues Deploying with Docker

I'm re-posting this from: invoiceninja/invoiceninja#1718 (comment) as I told this place may be more appropriate.

Hey,
I just wanted to give this tool a whirl and thought the easiest way to deploy it would be with docker. Unfortunately it doesn't appear to be working for me. I just get an "Unable to connect message" in Firefox.

I'm running Ubuntu 16.04.3 with docker and I set up a test mysql database which is listening on 0.0.0.0. The test "ninja" database can be accessed by the ninja user with the ninja password.

I then ran this to get set up:

#!/bin/bash

# Create local volume directories
mkdir -p $HOME/invoice-ninja/logo
mkdir -p $HOME/invoice-ninja/storage

docker run -d \
  -e APP_ENV='production' \
  -e APP_DEBUG=0 \
  -e APP_URL='http://10.2.0.11' \
  -e APP_KEY='SomeRandomStringSomeRandomString' \
  -e APP_CIPHER='AES-256-CBC' \
  -e DB_TYPE='mysql' \
  -e DB_STRICT='false' \
  -e DB_HOST='10.2.0.11' \
  -e DB_DATABASE='ninja' \
  -e DB_USERNAME='ninja' \
  -e DB_PASSWORD='ninja' \
  -v $HOME/invoice-ninja/logo:/var/www/app/public/logo \
  -v $HOME/invoice-ninja/storage:/var/www/app/storage \
  -p '80:80' \
  invoiceninja/invoiceninja

In this case 10.2.0.11 is the IP of my machine.

I see that the dockerhub page states to go to port 8000, but then goes on to use port 80 in the docker run command example.

Also the dockerhub page has the command without the necessary \ characters to go multi-line, but maybe that would work in some other environment (e.g. not BASH on linux)

The output of my docker ps is:

CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS                          NAMES
baa2f0d68ce9        invoiceninja/invoiceninja   "/entrypoint.sh ph..."   3 seconds ago       Up 2 seconds        0.0.0.0:80->80/tcp, 9000/tcp   quizzical_golick

I'm not sure what port 9000 is being used for either.

What am I missing?

Also, why is there a separate project just for docker instead of having the dockerfiles any anything else necessary for docker within a docker folder? This would allow the application layer and deployment to always be in sync. E.g. if you decided to use a feature from php 7.2 (when it comes out), the developers could make the necessary dockerfile change at the point of using the feature.

Docker run doesn't work. MySQL Connection Refused

Apertures-iMac:example apsec$ docker run -e APP_ENV='production' -e APP_DEBUG=0 -e APP_URL='http://ninja.dev' -e APP_KEY='SomeRandomStringSomeRandomString' -e APP_CIPHER='AES-256-CBC' -e DB_TYPE='mysql' -e DB_STRICT='false' -e DB_HOST='localhost' -e DB_DATABASE='ninja' -e DB_USERNAME='ninja' -e DB_PASSWORD=‘ninja’ -p '80:80' invoiceninja/invoiceninja
MySQL Connection Error: SQLSTATE[HY000] [2002] No such file or directory
MySQL Connection Error: SQLSTATE[HY000] [2002] No such file or directory
MySQL Connection Error: SQLSTATE[HY000] [2002] No such file or directory
MySQL Connection Error: SQLSTATE[HY000] [2002] No such file or directory
MySQL Connection Error: SQLSTATE[HY000] [2002] No such file or directory

DB User Access Denied.

Hi,
First off I am sorry if this is the wrong place to post this, but I am having some issues with the DB setup for running the docker image.
After running the docker image I am trying to test the db connection.
I have added a user 'ninja' and granted privileges as described in the Setup description.
However, when testing the connection I get the following error:
SQLSTATE[HY000] [1045] Access denied for user 'ninja'@'xxxx.xxxx.xxxx.xxxx' (using password: YES)

I have verified that the password is correct, and I am able to connect and use the user on the db directly from the container.
I can connect to mysql with user and password from terminal like this :
mysql -u ninja -p
enter password

And then I can use the db and I have verified it has all privileges.

If I try to use the root user instead of the ninja user from the setup page with the root password, it seems to work, but not with the created ninja user. Does this have something to do with me having created the user @'localhost', and when it tries to connect from the application, it has an ip? (the error shows an IP adress, not 'localhost'.

using SSL with docker-compose

Hi there,

I've made my docker-compose like this (I already have a SQL server running, hence the environment variables):

app:
  image: invoiceninja/invoiceninja
  environment:
    - DB_USERNAME=root
    - DB_PASSWORD=legaal

web:
  image: nginx
  volumes:
    - ./nginx.conf:/etc/nginx/nginx.conf:ro
  links:
    - app
  volumes_from:
    - app
  ports:
    - 9292:80

And then run another nginx instance outside docker that has the SSL configuration:

# HTTP
server {
    server_name xxx;
    # redirect non-SSL to SSL
    location / {
        rewrite     ^ https://$server_name$request_uri? permanent;
    }
}

# HTTPS server
server {
    listen 443 ssl spdy; # we enable SPDY here
    server_name xxx;

    ssl_certificate     /etc/webmin/xxx.pem;
    ssl_certificate_key /etc/webmin/xxx.pem;

    location / {
        proxy_pass http://127.0.0.1:9292;
        proxy_set_header Host $host;

        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto https;
    }
}

The site shows up but the server still serves some resources as http, as we can see in this screenshot:
screenshot from 2016-08-23 09-47-29

Docker compose example doesn't work

Tried the example docker compose using Docker version 1.12.0, build 8eab29e
Docker compose does start up but could can't browse.
invoice-ninja$ docker-compose up Starting invoiceninja_db_1 Recreating invoiceninja_app_1 Recreating invoiceninja_web_1 Attaching to invoiceninja_db_1, invoiceninja_app_1, invoiceninja_web_1 db_1 | 2016-07-31T18:11:47.575708Z 0 [Note] mysqld (mysqld 5.7.13) starting as process 1 ... db_1 | 2016-07-31T18:11:47.578590Z 0 [Note] InnoDB: PUNCH HOLE support available db_1 | 2016-07-31T18:11:47.578611Z 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins db_1 | 2016-07-31T18:11:47.578616Z 0 [Note] InnoDB: Uses event mutexes db_1 | 2016-07-31T18:11:47.578620Z 0 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier db_1 | 2016-07-31T18:11:47.578625Z 0 [Note] InnoDB: Compressed tables use zlib 1.2.8 db_1 | 2016-07-31T18:11:47.578630Z 0 [Note] InnoDB: Using Linux native AIO db_1 | 2016-07-31T18:11:47.578793Z 0 [Note] InnoDB: Number of pools: 1 db_1 | 2016-07-31T18:11:47.578874Z 0 [Note] InnoDB: Using CPU crc32 instructions db_1 | 2016-07-31T18:11:47.583059Z 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M db_1 | 2016-07-31T18:11:47.588532Z 0 [Note] InnoDB: Completed initialization of buffer pool db_1 | 2016-07-31T18:11:47.590563Z 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority(). db_1 | 2016-07-31T18:11:47.602359Z 0 [Note] InnoDB: Highest supported file format is Barracuda. db_1 | 2016-07-31T18:11:47.609462Z 0 [Note] InnoDB: Creating shared tablespace for temporary tables db_1 | 2016-07-31T18:11:47.609523Z 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please wait ... db_1 | 2016-07-31T18:11:47.638395Z 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB. db_1 | 2016-07-31T18:11:47.639046Z 0 [Note] InnoDB: 96 redo rollback segment(s) found. 96 redo rollback segment(s) are active. db_1 | 2016-07-31T18:11:47.639055Z 0 [Note] InnoDB: 32 non-redo rollback segment(s) are active. app_1 | [31-Jul-2016 18:11:47] NOTICE: fpm is running, pid 1 db_1 | 2016-07-31T18:11:47.639746Z 0 [Note] InnoDB: 5.7.13 started; log sequence number 12129524 db_1 | 2016-07-31T18:11:47.640414Z 0 [Note] InnoDB: Loading buffer pool(s) from /var/lib/mysql/ib_buffer_pool app_1 | [31-Jul-2016 18:11:47] NOTICE: ready to handle connections db_1 | 2016-07-31T18:11:47.640956Z 0 [Note] Plugin 'FEDERATED' is disabled. db_1 | 2016-07-31T18:11:47.641859Z 0 [Note] InnoDB: Buffer pool(s) load completed at 160731 18:11:47 db_1 | 2016-07-31T18:11:47.642242Z 0 [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key db_1 | 2016-07-31T18:11:47.642256Z 0 [Note] Server hostname (bind-address): '*'; port: 3306 db_1 | 2016-07-31T18:11:47.642284Z 0 [Note] IPv6 is available. db_1 | 2016-07-31T18:11:47.642292Z 0 [Note] - '::' resolves to '::'; db_1 | 2016-07-31T18:11:47.642307Z 0 [Note] Server socket created on IP: '::'. db_1 | 2016-07-31T18:11:47.645677Z 0 [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode. db_1 | 2016-07-31T18:11:47.645696Z 0 [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode. db_1 | 2016-07-31T18:11:47.647800Z 0 [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode. db_1 | 2016-07-31T18:11:47.653909Z 0 [Note] Event Scheduler: Loaded 0 events db_1 | 2016-07-31T18:11:47.654295Z 0 [Note] mysqld: ready for connections. db_1 | Version: '5.7.13' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL) app_1 | 172.17.0.4 - 31/Jul/2016:18:12:51 +0000 "GET /index.php" 500 web_1 | 172.17.0.1 - - [31/Jul/2016:18:12:51 +0000] "GET / HTTP/1.1" 500 8983 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"

Here's the compose file.
`db:
image: mysql
environment:
MYSQL_DATABASE: ninja
MYSQL_ROOT_PASSWORD: mdp

app:
image: invoiceninja/invoiceninja
links:
- db:mysql

web:
image: nginx
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
links:
- app
volumes_from:
- app
ports:
- 80`

Can't complete setup - Problem with version.txt ?

Hi,

I'm trying to run the service, but I have an error message once finishing the setup phase. I have copied all 3 files in the docker-compose folder, renamed the .env file, and I have added a maildev image. Looking in the logs folder, I have the following error :

2018-01-25 10:43:25 fopen(/var/www/app/storage/version.txt): failed to open stream: Permission denied: #0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'fopen(/var/www/...', '/var/www/app/ap...', 61, Array)
#1 /var/www/app/app/Http/Middleware/StartupCheck.php(61): fopen('/var/www/app/st...', 'w')
#2 /var/www/app/bootstrap/cache/compiled.php(10069): App\Http\Middleware\StartupCheck->handle(Object(Illuminate\Http\Request), Object(Closure))
#3 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#4 /var/www/app/app/Http/Middleware/QueryLogging.php(32): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#5 /var/www/app/bootstrap/cache/compiled.php(10069): App\Http\Middleware\QueryLogging->handle(Object(Illuminate\Http\Request), Object(Closure))
#6 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#7 /var/www/app/app/Http/Middleware/DuplicateSubmissionCheck.php(41): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#8 /var/www/app/bootstrap/cache/compiled.php(10069): App\Http\Middleware\DuplicateSubmissionCheck->handle(Object(Illuminate\Http\Request), Object(Closure))
#9 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#10 /var/www/app/bootstrap/cache/compiled.php(3312): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#11 /var/www/app/app/Http/Middleware/VerifyCsrfToken.php(44): Illuminate\Foundation\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#12 /var/www/app/bootstrap/cache/compiled.php(10069): App\Http\Middleware\VerifyCsrfToken->handle(Object(Illuminate\Http\Request), Object(Closure))
#13 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#14 /var/www/app/bootstrap/cache/compiled.php(13749): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#15 /var/www/app/bootstrap/cache/compiled.php(10069): Illuminate\View\Middleware\ShareErrorsFromSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#16 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#17 /var/www/app/bootstrap/cache/compiled.php(12155): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#18 /var/www/app/bootstrap/cache/compiled.php(10069): Illuminate\Session\Middleware\StartSession->handle(Object(Illuminate\Http\Request), Object(Closure))
#19 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#20 /var/www/app/bootstrap/cache/compiled.php(13495): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#21 /var/www/app/bootstrap/cache/compiled.php(10069): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#22 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#23 /var/www/app/bootstrap/cache/compiled.php(13432): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#24 /var/www/app/bootstrap/cache/compiled.php(10069): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#25 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#26 /var/www/app/bootstrap/cache/compiled.php(10054): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#27 /var/www/app/bootstrap/cache/compiled.php(8356): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#28 /var/www/app/bootstrap/cache/compiled.php(8347): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#29 /var/www/app/bootstrap/cache/compiled.php(8338): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#30 /var/www/app/bootstrap/cache/compiled.php(2575): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#31 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#32 /var/www/app/bootstrap/cache/compiled.php(3374): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#33 /var/www/app/bootstrap/cache/compiled.php(10069): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#34 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#35 /var/www/app/vendor/barryvdh/laravel-cors/src/HandlePreflight.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#36 /var/www/app/bootstrap/cache/compiled.php(10069): Barryvdh\Cors\HandlePreflight->handle(Object(Illuminate\Http\Request), Object(Closure))
#37 /var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(33): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#38 /var/www/app/bootstrap/cache/compiled.php(10054): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#39 /var/www/app/bootstrap/cache/compiled.php(2519): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#40 /var/www/app/bootstrap/cache/compiled.php(2503): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#41 /var/www/app/public/index.php(51): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))

And there is no version.txt file in storage folder. Any idea ?

Update Issue from 3.4.1 to 3.4.2

I was updating from version 3.4.1 to version 3.4.2 with docker-compose stop than docker-compose pull && docker-compose up -d and get an error now when I try to access invoiceninja.

web error: Whoops, looks like something went wrong.

When I start without the -d option in docker-compose I see nothing suspicious.

What can I do?

Docker-compose example failing because of mcrypt_get_iv_size()

Hello, upon cloning the repository and running the docker-compose, deployment runs fine but access returns an internal server error because an mcrypt function is deprecated:

ErrorException in McryptEncrypter.php line 46: Function mcrypt_get_iv_size() is deprecated

    in McryptEncrypter.php line 46
    at HandleExceptions->handleError('8192', 'Function mcrypt_get_iv_size() is deprecated', '/var/www/app/vendor/laravel/framework/src/Illuminate/Encryption/McryptEncrypter.php', '46', array('key' => 'SomeRandomString', 'cipher' => 'rijndael-128')) in McryptEncrypter.php line 46
    at McryptEncrypter->__construct('SomeRandomString', 'rijndael-128') in compiled.php line 7827
    at EncryptionServiceProvider->getEncrypterForKeyAndCipher('SomeRandomString', 'rijndael-128') in compiled.php line 7819
    at EncryptionServiceProvider->Illuminate\Encryption\{closure}(object(Application), array()) in compiled.php line 1353
    at Container->build(object(Closure), array()) in compiled.php line 1309
    at Container->make('encrypter', array()) in compiled.php line 1874
    at Application->make('encrypter') in compiled.php line 1410
    at Container->resolveClass(object(ReflectionParameter)) in compiled.php line 1387
    at Container->getDependencies(array(object(ReflectionParameter)), array()) in compiled.php line 1373
    at Container->build('Illuminate\Cookie\Middleware\EncryptCookies', array()) in compiled.php line 1309
    at Container->make('Illuminate\Cookie\Middleware\EncryptCookies', array()) in compiled.php line 1874
    at Application->make('Illuminate\Cookie\Middleware\EncryptCookies') in compiled.php line 10016
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request)) in compiled.php line 3286
    at CheckForMaintenanceMode->handle(object(Request), object(Closure))
    at call_user_func_array(array(object(CheckForMaintenanceMode), 'handle'), array(object(Request), object(Closure))) in compiled.php line 10021
    at Pipeline->Illuminate\Pipeline\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in Pipeline.php line 32
    at Pipeline->Illuminate\Routing\{closure}(object(Request))
    at call_user_func(object(Closure), object(Request)) in compiled.php line 10006
    at Pipeline->then(object(Closure)) in compiled.php line 2366
    at Kernel->sendRequestThroughRouter(object(Request)) in compiled.php line 2350
    at Kernel->handle(object(Request)) in index.php line 51

The docker-compose script is unchanged from the clone.

Thanks !

Upgrade

I am very new to Docker. I had someone originally set up my Docker system.
I've figured out and successfully upgrade from 3.81 to 3.92 by:

  1. Saved a backup copy of the mysql subdirectory
  2. Stopped and then erased the 3 linked containers (invoiceninja, mysql, nginx)
  3. Going into the appropriate parent directory in SSH as root
  4. Type "docker-compose up -d" when in the correct parent directory containing the database
  5. It automatically pulls the latest version of invoiceninja, and starts up the container
    After the latest 4.0.0 release, the containers go live, but when going back to he same webpage that worked before, mydomain/upgrade comes up and it cannot find the page. If I enter mydomain.com/login, it gives me a non-graphical version of the login page, but the login and password doesn't work.

Same effect after trying 4.0.1
When I do the same as above, but in my docker-compose.yml file enter invoiceninja/invoiceninja:3.9.2 and rerun the above, it downloads the 3.9.2 version and it runs perfectly fine.

The prior upgrade from 3.9.0 to 3.9.2 worked perfectly fine with above sequence.
Why doesn't the 4.0.0 upgrade work the same way?
I have also tried erasing all 3 containers and all 3 images (invoiceninja, mysql, and nginx) but get the same result.
Thanks.

Install Error (Invalid default value for 'created_at') using Docker File

production.ERROR: exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created_at'' in /var/www/app/vendor/laravel/framework/src/Illuminate/Database/Connection.php:362

# php artisan --version
Laravel Framework version 5.0.33

To get it working I had to
ssh into the app server
# cd /var/www/app
# composer update

  • Removing laravel/framework (v5.0.33)
  • Installing laravel/framework (v5.0.34)
  • Downloading: 100%

Seem to be a framework issue see laravel/framework#3602

/var/www/app/docker-backup-storage/ not found on restart

steps to replicate:

docker-compose up
*kill the process*
docker-compose up

which will yield this error:

app_1  | ls: cannot access /var/www/app/docker-backup-storage/: No such file or directory
invoiceninja_app_1 exited with code 2

the work around I had was to run docker-compose rm app and then run docker-compose up again.

Cron does not send emails/reminders

I've noticed that using the example docker compose file, the cron container starts and runs, however the emails and reminders are not sent.

I have configured my instances to send through Mailgun, and manual sends from the app itself are working correctly.

using v.2.8.0 of Invoice Ninja. debug doesnt show anything either.

Any ideas where I can start to look?

Can't force clear text connection for troubleshooting

I'm testing out the docker version and I need to connect it to an SMTP server.
I've connected the most popular docker smtp server from dockerhub called namshi/smtp.
Although I can make connections using openssl to it invoiceninja is refusing.
I'm using docker application linking to enable networking between containers.

smtp_1 | 306 LOG: MAIN smtp_1 | 306 TLS error on connection from ninja ([172.17.0.5]) 172.17.0.4: A TLS fatal alert has been received. smtp_1 | 306 LOG: smtp_connection MAIN smtp_1 | 306 SMTP connection from ninja ([172.17.0.5]) [172.17.0.4] closed by EOF

If I downgrade to SSL I can see it's trying to make a binary connection, which also fails.

smtp_1 | 307 LOG: MAIN REJECT smtp_1 | 307 SMTP protocol synchronization error (input sent without waiting for greeting): rejected connection from H=ninja [172.17.0.4] input="\026\003\001\002"

If there a way to force a plain clear text connection?

I've tried a couple of things like editing .env file but I have had no success.
docker-compose.yml.zip

docker-compose: could not synchronise with container process

I am trying to test run invoiceninja using the docker-compose.yml in the Readme. No customizations in the docker-compose.yml.

When I run docker-compose up I get:

Creating root_db_1
Creating root_app_1
Creating root_web_1
ERROR: Cannot start container 7262703d16de137f3d9cc4636225104a71edd8480570f43cb82e82adf8f25179: [10] System error: could not synchronise with container process

Indeed the web container fails to start:

# docker ps -a
CONTAINER ID        IMAGE                       COMMAND                  CREATED             STATUS              PORTS               NAMES
7262703d16de        nginx                       "nginx -g 'daemon off"   34 seconds ago      Created                                 root_web_1
65244c1fb692        invoiceninja/invoiceninja   "/entrypoint.sh php-f"   38 seconds ago      Up 34 seconds       80/tcp, 9000/tcp    root_app_1
6cadcb105ee6        mysql                       "docker-entrypoint.sh"   39 seconds ago      Up 38 seconds       3306/tcp            root_db_1

Log says:

# docker logs root_web_1
Timestamp: 2016-06-14 10:34:19.298956995 +0300 EEST
Code: System error

Message: not a directory

Frames:

---
0: setupRootfs
Package: github.com/opencontainers/runc/libcontainer
File: rootfs_linux.go@42

---
1: Init
Package: github.com/opencontainers/runc/libcontainer.(*linuxStandardInit)
File: standard_init_linux.go@75

---
2: StartInitialization
Package: github.com/opencontainers/runc/libcontainer.(*LinuxFactory)
File: factory_linux.go@255

---
3: initializer
Package: github.com/docker/docker/daemon/execdriver/native
File: init.go@35

---
4: Init
Package: github.com/docker/docker/pkg/reexec
File: reexec.go@26

---
5: main
Package: main
File: docker.go@18

---
6: main
Package: runtime
File: proc.go@188

---
7: goexit
Package: runtime
File: asm_amd64.s@1998

Docker info:

# docker info
Containers: 3
 Running: 2
 Paused: 0
 Stopped: 1
Images: 5
Server Version: 1.10.3
Storage Driver: aufs
 Root Dir: /var/lib/docker/aufs
 Backing Filesystem: extfs
 Dirs: 57
 Dirperm1 Supported: true
Execution Driver: native-0.2
Logging Driver: json-file
Plugins: 
 Volume: local
 Network: host bridge null
Kernel Version: 4.4.0-22-generic
Operating System: Ubuntu 16.04 LTS
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 7.784 GiB
Name: adm01mc604
ID: TQD3:UVA5:MKNC:RF5G:7AKF:IYN4:JSDM:LNKO:A6UB:35E6:HEC2:YTFY
WARNING: No swap limit support

Any hints?

References

Persist data & recreate container -> Where is configuration stored after setup?

According to dockerfiles comment:

make your data persistant, you have to mount /var/www/app/public/logo and /var/www/app/storage.

  • I did as proposed by mounting host directories and stepped through the setup process in browser
  • afterwards I logged in and made some changes
  • I stopped the containers, removed them and recreated them with docker-compose up

RESULT:
The is no data in the host mounted folders AND I get redirected to the setup page over and over again (can not complete it a second time, I guess due to mysql already being initialized) without any errors.

GOAL:
I want to move the invoiceninja data folders and mysql folders around or even onto a different machine and fire up all needed services via docker-compose up -d, providing the variable for the host mount folder.

I really appreciate your help.

Suggestion: Add Cronjobs to docker image

Hello!

After I solved the first, small problems, I have to say invoice ninja seems to be awesome! 👍

But I have a suggestion, it would be awesome if the cronjobs for invoiceninja would be included in the docker image as well.

Cheers,
Dom

Can't complete InvoiceNinja setup

Hi,

I am using InvoiceNinja in conjunction with a Traefik reverse proxy. Everything works properly after docker-compose up -d but I cannot complete the setup wizard. When I click Submit, the page loads for several seconds and then gives me error Call to a member function filter() on null. Why is this?

Docker Setup on Unraid not working

Hello,

I'm currently trying to setup the invoice-ninja docker on my unraid server but it doesn't seem to be working. I do not see any errors in the logs indicating an issue however i'm unable to access the web interface after setting several environmental variables.

Below are screenshots of my current configuration

VOLUME MAPPINGS and PORT FORWARD

home

ENV VARIABLES - i removed a few variables in screenshots

container 1
container 2
container 3

LOGS after starting docker - no errors

logs

It seems a BLANK .env file is being generated which is leading to my issue but i am not sure

file not generating properly

Error after setup

Hello!

I'm trying to get the docker image running. So far, I made it to the setup screen and I could run the setup.

After this, I always get "Whoops, looks like something went wrong." and in the laravel-error.log I get:

[2016-09-15 11:27:19] production.ERROR: ErrorException: fopen(/var/www/app/storage/version.txt): failed to open stream: Permission denied in /var/www/app/app/Http/Middleware/StartupCheck.php:58 Stack trace: #0 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleError(2, 'fopen(/var/www/...', '/var/www/app/ap...', 58, Array) #1 /var/www/app/app/Http/Middleware/StartupCheck.php(58): fopen('

Is there something wrong with the permissions in the image or did I something wrong?

Thanks in advance!

PDF not attached for recurring invoices

Hi!

I am facing an issue where the PDF is not attached to outgoing e-mails for recurring invoices.
If I resend it manually (even though it is already marked as sent) from the Invoices menu, the PDF gets attached.

I am using the latest self-hosted version with Docker. The local phatonjs setting is activated under E-Mail settings.

Looking at the error log revealed the following:

[2017-02-04 09:08:11] production.ERROR: PhantomJS - Failed to create pdf: Invalid URL provided: /view/zPjEACdpQmKIpoOiWt1b35bjUAZhFIJo?phantomjs=true {"context":"PHP","user_id":0,"account_id":0,"user_name":"","method":"GET","url":"http://localhost","user_agent":"","ip":"127.0.0.1","count":1} []
Could it be that the cron tries to access localhost which should actually be the web according to the example docker-compose file?

Update:
I just tried executing ./artisan ninja:send-invoices from the app container which gives the same result.

Can someone help me out here?

Some small documentation issues with this repository

I have recently used modified version of docker compose from this script to succesfully deploy invoice ninja for a client.

However, as a person without PHP experience, i have run into some issues:

  1. It appears that APP_KEY needs to conform to specified format (proper length, etc). It would be usefull to have this information in documentation here;
  2. Somehow storage folders had botched owner (root:root) while (at least partially) they need to be write-able by www-data (e.g. session storage);

Anyways thanks for this repository it is great :)

Connection refused while connecting to upstream

Hey Folks,

I'm a bit of a blockhead just now. I try to setup invoice ninja along with an nginx-proxy from jwilder with docker-compose. No matter what I do, I get the following error:

[error] 6#6: *1 connect() failed (111: Connection refused) while connecting to upstream, client: XXX.XX.X.X, server: application, request: "GET / HTTP/1.1", upstream: "fastcgi://XXX.XX.X.X:9000", host: "domain.tld"

Do you guys have an Idea?

This is my docker-compose.yml:

version: '3'

volumes:
  invoice-db-data:
     driver: local-persist
     driver_opts:
       mountpoint: ${CONTAINERVOLUME}/var/lib/mysql
  invoice-app-data:
     driver: local-persist
     driver_opts:
       mountpoint: ${CONTAINERVOLUME}/var/www/app

services:
  database:
     image: mysql
     restart: unless-stopped
     volumes:
       - invoice-db-data:/var/lib/mysql
     environment:
       - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
       - MYSQL_DATABASE=${MYSQL_DATABASE}
       - MYSQL_USER=${MYSQL_USER}
       - MYSQL_PASSWORD=${MYSQL_PASSWORD}

  webserver:
    image: nginx
    restart: unless-stopped
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
      - invoice-app-data:/var/www/app
    environment:
      - VIRTUAL_HOST=${VIRTUAL_HOST}
      - VIRTUAL_PROTO=http
      - VIRTUAL_PORT=80
      - LETSENCRYPT_HOST=${LETSENCRYPT_HOST}
      - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
    ports:
      - ${PROXYPORT}:80
    networks:
      - nginxproxy
      - default

  application:
    image: invoiceninja/invoiceninja
    restart: unless-stopped
    environment:
       - APP_DEBUG=1
       - APP_URL=http://${VIRTUAL_HOST}
       - DB_HOST=database
       - DB_DATABASE=${MYSQL_DATABASE}
       - DB_USERNAME=${MYSQL_USER}
       - DB_PASSWORD=${MYSQL_PASSWORD}
    depends_on:
      - database
      - webserver
    volumes:
      - invoice-app-data:/var/www/app

  cron:
    image: invoiceninja/invoiceninja
    restart: unless-stopped
    user: www-data
    environment:
       - APP_DEBUG=1
       - DB_HOST=database
       - DB_DATABASE=${MYSQL_DATABASE}
       - DB_USERNAME=${MYSQL_USER}
       - DB_PASSWORD=${MYSQL_PASSWORD}
    depends_on:
      - database
      - webserver
      - application
    entrypoint: |
      bash -c 'bash -s <<EOF
      trap "break;exit" SIGHUP SIGINT SIGTERM
      sleep 300s
      while /bin/true; do
        DB_USERNAME=${MYSQL_USER} DB_PASSWORD=${MYSQL_PASSWORD} /usr/local/bin/php /var/www/app/artisan ninja:send-invoices
        DB_USERNAME=${MYSQL_USER} DB_PASSWORD=${MYSQL_PASSWORD} /usr/local/bin/php /var/www/app/artisan ninja:send-reminders
        sleep 1d
      done
      EOF'

networks:
  nginxproxy:
    external:
      name: ${NGINXPROXYNETWORK}

My nginx.conf:

user www-data;

events {
  worker_connections 768;
}

http {
    upstream backend {
        server application:9000;
    }
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    gzip on;
    gzip_disable "msie6";

    server {
        listen      80 default;
        server_name application;

        root /var/www/app/public;

        index index.php;

        charset utf-8;

        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }

        location = /favicon.ico { access_log off; log_not_found off; }
        location = /robots.txt  { access_log off; log_not_found off; }

        sendfile off;

        location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass backend;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_intercept_errors off;
            fastcgi_buffer_size 16k;
            fastcgi_buffers 4 16k;
        }

        location ~ /\.ht {
            deny all;
        }
    }
}

persistent data and update

From the invoiceninja repos, dixit @freskimo

If you setup invoice ninja the first time in a docker container the declared volume /var/www/app/public is persistent. This means that if the container is restarted the changes made on this directory different from the original image are persisted. Once you want to update a new version you pull the new image and stop the current container then you start the same container with the new image. Because the volumes are persistent the changes reflected in the new image are not copied over the existing files. This means all files in /var/www/app/public are not updated with the new version.

Data persistence doesn't work

The README says 'To make your data persistant, you have to mount /var/www/app/public/logo and /var/www/app/storage.'

Well, I added the following to the app section in docker-compose.yml,

    ......
    volumes:
      - ./data/storage:/var/www/app/storage
      - ./data/logo:/var/www/app/public/logo
# docker-compose up

... did lots of configuration through the web UI ..

# docker-compose down
# docker-compose up

and everything is gone and I start from scratch!

Spelling errors

README: persistent, not persistant
Dir name: example, not exemple

Is there any issue with compose file (from README) and the web container?

No matter on which host I try to start invoiceninja via docker-compose I only get log messages from container db_1 and app_1, but no log messages indicating any action in web_1 at all.

I cannot reach out to invoiceninja via webbrowser, appears to be not running.
All containers seem to be up as stated by docker ps (docker-compose ps).

I really appreciate your help!

A non well formed numeric value encountered

I'm using this docker image in combination with jwilder/nginx-proxy. Everything looks good but when I try to submit the install form, I get a 500 error.

The only error I get in the logs is Debugbar exception: A non well formed numeric value encountered [] [].

I tried a composer update but it didn't solve the issue.

Do you have any idea?

laravel-error.log:

[2017-08-31 23:11:28] production.ERROR: Debugbar exception: A non well formed numeric value encountered [] []

docker-compose.yml:

version: '3'

services:
  db:
    image: mysql
    environment:
      MYSQL_DATABASE: ninja
      MYSQL_ROOT_PASSWORD: pwd

  app:
    image: invoiceninja/invoiceninja
    links:
      - db:mysql
    env_file: .env
    networks:
      - nginx-proxy
  web:
    image: nginx
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
    links:
      - app:app
    ports:
      - 8082:80
    environment:
      VIRTUAL_HOST: invoices.mydomain.com
    networks:
      - nginx-proxy

networks:
  nginx-proxy:
    external:
      name: nginx-proxy

nginx.conf:

user www-data;

events {
  worker_connections 768;
}

http {
    upstream backend {
        server app:9000;
    }
    include /etc/nginx/mime.types;
    default_type application/octet-stream;
    gzip on;
    gzip_disable "msie6";

    server {
        listen      80 default;
        server_name your_ininja_site;

        root /var/www/app/public;

        index index.php;

        charset utf-8;

        location / {
            try_files $uri $uri/ /index.php?$query_string;
        }

        location = /favicon.ico { access_log off; log_not_found off; }
        location = /robots.txt  { access_log off; log_not_found off; }

        sendfile off;

        location ~ \.php$ {
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass backend;
            fastcgi_index index.php;
            include fastcgi_params;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_intercept_errors off;
            fastcgi_buffer_size 16k;
            fastcgi_buffers 4 16k;
	    fastcgi_param HTTPS 1;
        }

        location ~ /\.ht {
            deny all;
        }
    }
}

.env:

APP_DEBUG=1
APP_URL=https://invoices.mydomain.com
DB_USERNAME=root
DB_PASSWORD=pwd
DB_HOST=mysql
MAIL_HOST=mail.service.host
MAIL_USERNAME=username
MAIL_PASSWORD=password
MAIL_DRIVER=smtp
MAIL_FROM_NAME="My name"
[email protected]
TRUSTED_PROXIES='10.0.0.0/8,172.16.0.0/12,192.168.0.0/16'

Wrong App URL

Hey there,
I'm not sure how this can happen but:

I've setup the .env and changed the APP_URL to an normal domain (so no localhost address inside here).
But.. when I run the docker-compose and load the site... all (!) links in the markup are related to to the localhost:/ address (see screenshot below).

My setup is:

  • This docker-container
  • NGINX on the host machine to proxy the localhost address
  • Debian 9, lates docker, latest docker-compose, latest invoiceninja repo-release

So... in theory:

InvoiceNinja-Nginx Container is running at Port 80 and through the docker-compose config file forward it to the host at port 8002 so that I can proxy_pass this via the nginx installation on the host to any domain I want or at least to that one I defined in APP_URL?

I'm just a bit confused... so... maybe someone can explain me why InvoiceNinja is not using the APP_URL instead of the URL provided by InvoiceNinja-Nginx Container

(And yes, I tried this multiple time while deleting everything, removing all docker images etc
)

I added an screenshot to may, clarify it a bit more:
bildschirmfoto 2018-02-19 um 16 01 16

issue with nginx conf

Hello,

tried to run the docker compose files but had an issue with nginx.conf !
Any idea ? Thanks !

ERROR: for app_web_1 Cannot start service web: OCI runtime create failed: container_linux.go:296: starting container process caused "process_linux.go:398: container init caused "rootfs_linux.go:58: mounting \"/var/www/app/nginx.conf\" to rootfs \"/var/lib/docker/overlay2/f19ad8e20e3b80dcad20446bb35155589939a98262da1c38fd470933a2fadf88/merged\" at \"/var/lib/docker/overlay2/f19ad8e20e3b80dcad20446bb35155589939a98262da1c38fd470933a2fadf88/merged/etc/nginx/nginx.conf\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type

ERROR: for web Cannot start service web: OCI runtime create failed: container_linux.go:296: starting container process caused "process_linux.go:398: container init caused "rootfs_linux.go:58: mounting \"/var/www/app/nginx.conf\" to rootfs \"/var/lib/docker/overlay2/f19ad8e20e3b80dcad20446bb35155589939a98262da1c38fd470933a2fadf88/merged\" at \"/var/lib/docker/overlay2/f19ad8e20e3b80dcad20446bb35155589939a98262da1c38fd470933a2fadf88/merged/etc/nginx/nginx.conf\" caused \"not a directory\""": unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type
ERROR: Encountered errors while bringing up the project.

Issue adding initial user/finishing setup

Hello,

I just cloned this repo and did a docker-compose up in the example folder. Everything installed correctly but I am getting an error after trying to go through setup.

FatalThrowableError in AccountRepository.php line 66: Call to a member function filter() on null

Thank you in advance!

Edit:
whole error: https://pastebin.com/4DFy20S3

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.