Comments (13)
this is closed by c27b04b
@hillelcoren I will try to make a pr to invoiceninja project... asap
from dockerfiles.
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.
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.
What is wrong in doing this at the level container ?
from dockerfiles.
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.
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.
Is running db:seed sufficient? Or should migrate also be run?
from dockerfiles.
Are these the commands that need to be run?
php artisan optimize --force
php artisan migrate --force
php artisan db:seed --force
from dockerfiles.
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.
Yes, those are the commands needed to initially setup the app.
You can combine the last two: php artisan migrate --seed
from dockerfiles.
AFAIK the global seed command should run only once
from dockerfiles.
@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.
It seems like a good idea to me...
from dockerfiles.
Related Issues (20)
- Grey screen after successful setup
- XMLHttpRequest error when requesting PDF files - after migrating between servers HOT 3
- QUEUE_CONNECTION configuration in Docker - can't find clear answer. HOT 1
- not opening login page
- Unable to view / print / download PDF invoices in docker HOT 11
- [BUG] Docker selfhosted bug HOT 8
- Connection reset by peer error with docker install HOT 2
- Raspberry Pi DB Error HOT 4
- dockerhub page says port 80 is opened, but it's port 9000 fcgi that is opened HOT 11
- Docker in k8s, testing, slow initial page load (including page refresh) HOT 15
- Tax line item not displaying in Totals area of invoice HOT 2
- after upgrade empty white page HOT 2
- Blank screen after upgrade HOT 5
- Permissions Error with Lost+Found Directory HOT 2
- git clone not pulling latest version HOT 6
- Update helm image? HOT 2
- Container startup only works with bind mount; `cp: can't create directory '/var/www/app/storage/app': Permission denied` HOT 5
- Http links requested when visiting a https page HOT 1
- Helm Chart commonLabels vs podLabels
- Database Availability Race Condition during Intialisation
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dockerfiles.