Log Rotate

The Bitwarden logs can be pretty verbose, and have managed to fill the VM's small filesystem a few times. When this happens, scary side effects will present - for example successful signin, but an empty valut, or sync failures.

Use the following docker-compose.override.yml file to make docker rotate the logfiles:

version: '3'

services:
  mssql:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
        compress: "true"

  web:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
        compress: "true"

  attachments:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
        compress: "true"

  api:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
        compress: "true"

  identity:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
        compress: "true"

  sso:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
        compress: "true"

  admin:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
        compress: "true"

  portal:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
        compress: "true"

  icons:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
        compress: "true"

  notifications:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
        compress: "true"

  events:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
        compress: "true"

  nginx:
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"
        compress: "true"

Update Services

You can either use the bitwarden.sh script that the project provides, or run the following:

COMPOSE_FILE="docker-compose.yml:docker-compose.override.yml" docker-compose up -d

Confirm Configuration

You can then confirm that the configuration has taken place by running the following:

docker ps --format "{{.ID}}\t{{.Names}}" \
  | grep -E $'\tbitwarden-' \
  | while read container _; do \
    docker inspect "${container}" \
      | jq -c '.[].HostConfig.LogConfig'
  done

Every line produced should read:

{"Type":"json-file","Config":{"compress":"true","max-file":"5","max-size":"10m"}}