diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index 8b17cbca50..4fa764632e 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -65,6 +65,11 @@ async function bootstrap() { }); app.enableCors(); + + // Let the open requests and the active queue jobs finish on SIGTERM before + // the process stops + app.enableShutdownHooks(); + app.enableVersioning({ defaultVersion: '1', type: VersioningType.URI diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 8c69e5420e..091cbd04d6 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -5,6 +5,9 @@ services: container_name: ghostfolio restart: unless-stopped init: true + # Time for the open requests and the active queue jobs to finish before + # the container is killed + stop_grace_period: 1m cap_drop: - ALL security_opt: