Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ UPDATE_CHECK_ENABLED=false

# Logging path
# By default, it will log in the standard Symfony directory: var/log/prod.log (for production)
# You can use /dev/null here if you want to discard logs entirely
# You can use /dev/null here if you want to discard logs entirely.
# Docker installations use /dev/stdout by default

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You only modified one of the two Dockerfiles

LOG_FILE_PATH="%kernel.logs_dir%/%kernel.environment%.log"

# Trust the immediate proxy for X-Forwarded-* headers including HTTPS detection.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ WEBDAV_HOMES_DIR=

**h. The log file path**

You can use an absolute file path here, and you can use Symfony's `%kernel.logs_dir%` and `%kernel.environment%` placeholders if needed (as in the default value). Setting it to `/dev/null` will disable logging altogether.
You can use an absolute file path here, and you can use Symfony's `%kernel.logs_dir%` and `%kernel.environment%` placeholders if needed (as in the default value). Setting it to `/dev/null` will disable logging altogether. Docker installations use `/dev/stdout` by default.

```shell
LOG_FILE_PATH="%kernel.logs_dir%/%kernel.environment%.log"
Expand Down
7 changes: 3 additions & 4 deletions docker/Dockerfile-standalone
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ FROM base-image
ENV APP_ENV=prod

ENV PHP_OPCACHE_MEMORY_CONSUMPTION="256" \
PHP_OPCACHE_MAX_WASTED_PERCENTAGE="10"
PHP_OPCACHE_MAX_WASTED_PERCENTAGE="10" \
LOG_FILE_PATH="/dev/stdout"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The compose setup overrides the new default. docker/.env still sets LOG_FILE_PATH="%kernel.logs_dir%/%kernel.environment%.log"


LABEL org.opencontainers.image.authors="tchap@tchap.me"
LABEL org.opencontainers.image.url="https://github.com/tchapi/davis/pkgs/container/davis-standalone"
Expand All @@ -96,11 +97,9 @@ RUN APP_ENV=prod COMPOSER_ALLOW_SUPERUSER=1 composer install --no-ansi --no-dev
&& php ./vendor/symfony/intl/Resources/bin/compress

# Caddy: web server
RUN mkdir -p /var/log/caddy
COPY ./docker/configurations/Caddyfile /etc/caddy/Caddyfile

# Supervisor: Process manager
RUN mkdir -p /var/log/supervisor && mkdir -p /var/log/php-fpm
COPY ./docker/configurations/supervisord.conf /etc/supervisord.conf

# We want to use sockets inside the container between Caddy and PHP-fpm
Expand All @@ -123,4 +122,4 @@ HEALTHCHECK --interval=120s --timeout=10s --start-period=60s --retries=3 \
CMD ["curl", "--fail", "http://localhost:9000"]

# It's the Caddy port, not the PHP-fpm one (as we use sockets)
EXPOSE 9000
EXPOSE 9000
6 changes: 3 additions & 3 deletions docker/configurations/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ command=/usr/sbin/caddy run -c /etc/caddy/Caddyfile
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/caddy/access.log
stdout_logfile=/dev/stdout

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really want access logs in docker logs? It's noisy ...

stdout_logfile_maxbytes = 0

[program:php-fpm]
command=/usr/local/sbin/php-fpm --nodaemonize
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/php-fpm/access.log
stdout_logfile_maxbytes = 0
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes = 0