From 8a6622bbbbc1c891117f684fdea881dca8833850 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Lo=CC=88sken?= Date: Mon, 11 May 2020 09:08:59 +0200 Subject: [PATCH] Explanation how view log files Fix #137 * Better description how to find log files * Change default log to file but can be overridden by env var --- README.md | 27 +++++++++++++++++++++++++++ alpine/Dockerfile | 1 - 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index d08d990..2f3fe98 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,7 @@ docker run -d \ -e DB_DATABASE='ninja' \ -e DB_USERNAME='ninja' \ -e DB_PASSWORD='ninja' \ + -e LOG=errorlog \ -p '9000:9000' \ invoiceninja/invoiceninja ``` @@ -67,6 +68,32 @@ Run `cp .env.example .env` and change the environment variables as needed. The file assumes that all your persistent data is mounted from `/srv/invoiceninja/`. Once started, the application should be accessible at http://localhost:8000. + +## Debugging your Docker setup + +Even when running your Invoice Ninja setup with Docker - errors can occur. Depending on where the error happens - the webserver, Invoice Ninja or the database - different log files can be responsible. + +### Show logs without `docker-compose` + +If you are not running the `docker-compose` you first need to find the container id for your php container with `docker ps`. Then you can run + +```shell +docker logs -f +``` + +This gives you a constant output of the log files for the php container. + +### Show logs with `docker-compose` + +If you are running the `docker-compose` setup you can output all logs, from all containers, with the following command + +```shell +docker-compose logs -f +``` + +If you better want a physical log file in in your `storage/logs` folder, just remove this line `-e LOG=errorlog` from the [usage](#usage) command or change it to `-e LOG=single`. Both works. + + ### Known issues Phantomjs doesn't work on linux alpine https://github.com/ariya/phantomjs/issues/14186. diff --git a/alpine/Dockerfile b/alpine/Dockerfile index 0b828d4..95d3496 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -52,7 +52,6 @@ RUN curl -o ninja.zip -SL https://download.invoiceninja.com/ninja-v${INVOICENINJ ###### # DEFAULT ENV ###### -ENV LOG errorlog ENV SELF_UPDATER_SOURCE '' ENV PHANTOMJS_BIN_PATH /usr/local/bin/phantomjs