Skip to content

Commit

Permalink
Limit amount of output from docker when restarting container
Browse files Browse the repository at this point in the history
'docker-compose restart server' seems to replay all the logs, which on
my mac had reached 125M and it took quite a while to replay that much
data to the terminal.

Found on:

docker/compose#1083 (comment)

and documented here:

https://docs.docker.com/config/containers/logging/json-file/#options
  • Loading branch information
jogu committed Jul 28, 2018
1 parent 8b2ba55 commit d7c6d0e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docker-compose-dev.yml
Expand Up @@ -39,3 +39,9 @@ services:
- microauth:microauth
depends_on:
- mongodb
logging:
# limit logs retained on host
driver: "json-file"
options:
max-size: "500k"
max-file: "5"
6 changes: 6 additions & 0 deletions docker-compose.yml
Expand Up @@ -29,3 +29,9 @@ services:
- microauth:microauth
depends_on:
- mongodb
logging:
# limit logs retained on host
driver: "json-file"
options:
max-size: "500k"
max-file: "5"

0 comments on commit d7c6d0e

Please sign in to comment.