Git Product home page Git Product logo

Comments (13)

lalop avatar lalop commented on September 26, 2024 1

this is closed by c27b04b
@hillelcoren I will try to make a pr to invoiceninja project... asap

from dockerfiles.

lalop avatar lalop commented on September 26, 2024

The main reason is because I would like to intialize the database on first launch because the first migration can cause timeout via web request... but I didn't did it yet.

from dockerfiles.

freskimo avatar freskimo commented on September 26, 2024

This should happen in the application and not on the level of container...
I understand the problem but this is not the right approach. The fix is needed in the invoiceninja/invoiceninja git repo and not here.

A solution to the problem would be to split up the queries in chunks and run it in a queue.

from dockerfiles.

lalop avatar lalop commented on September 26, 2024

What is wrong in doing this at the level container ?

from dockerfiles.

freskimo avatar freskimo commented on September 26, 2024

You trying to fix a problem by solving it on a different location. This has a bad smell.
Other people hosting invoice ninja w/o docker have the same problem and this should be addressed in the application itself not on another level.

It is not wrong but docker files & entrypoints should stay as simple/clean as possible w/o too much extras. Offcourse you can add db imports, db backups, healthchecks... but this adds up to the startup time of the container e.g. when running multiple instances of the invoiceninja container with loadbalancing and you move all instances to a new location, then they first need to make a db call to see if there actually is a db. This process should happen as fast as possible.

In my understanding the docker way is to spin up a container as fast as possible

from dockerfiles.

freskimo avatar freskimo commented on September 26, 2024

The docker way would be the following:
initially
docker run --rm invoiceninja/invoiceninja php artisan db:seed --force
this results in a db seed and when this is finished the container will be removed, then:
docker run invoiceninja/invoiceninja
to run the app.

I am working on a better readme and will post it soon.

from dockerfiles.

freskimo avatar freskimo commented on September 26, 2024

Is running db:seed sufficient? Or should migrate also be run?

from dockerfiles.

freskimo avatar freskimo commented on September 26, 2024

Are these the commands that need to be run?

php artisan optimize --force
php artisan migrate --force
php artisan db:seed --force

from dockerfiles.

lalop avatar lalop commented on September 26, 2024

I think this is all, and for the update

php artisan optimize --force
php artisan migrate
php artisan db:seed --class=UpdateSeeder

according to http://docs.invoiceninja.com/en/latest/update.html

from dockerfiles.

hillelcoren avatar hillelcoren commented on September 26, 2024

Yes, those are the commands needed to initially setup the app.

You can combine the last two: php artisan migrate --seed

from dockerfiles.

lalop avatar lalop commented on September 26, 2024

AFAIK the global seed command should run only once

from dockerfiles.

lalop avatar lalop commented on September 26, 2024

@hillelcoren, do you think adding an install and update command that groups all the needed one for installing and updating could be a good thing ?

from dockerfiles.

hillelcoren avatar hillelcoren commented on September 26, 2024

It seems like a good idea to me...

from dockerfiles.

Related Issues (20)

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.