Sorunome / mx-puppet-bridge

Puppeting library for matrix
Apache License 2.0
95 stars 29 forks source link

Stopping docker container exceeds grace period #57

Open wvffle opened 4 years ago

wvffle commented 4 years ago

When I stop my docker container discord, steam and slack (basically all of mx-puppet-bridge based) bridges are exceeding the grace period defined in the docker-compose.yml every single time.

Setting the stop_grace_period to a low value does not satisfy me as those bridges are clearly not shutting down correctly. Logs do not contain any errors so probably the node server does not receive the SIGTERM

I have following docker-compose.yml:

version: '2.4'
services:
  discord:
    build: https://github.com/matrix-discord/mx-puppet-discord.git
    restart: always
    stop_grace_period: 2m
    volumes:
      - /opt/mx-puppet-discord:/data
    ports:
      - 8434:8434
JuniorJPDJ commented 4 years ago

App doesn't react on SIGTERM, it should shutdown itself if this signal is coming ;/

gyroplast commented 3 years ago

Consider executing the container process in an init system by adding init: true to the compose options, this will properly forward signals to the application and terminate the container gracefully within seconds as expected.

See https://docs.docker.com/compose/compose-file/compose-file-v2/#init for reference.