Skip to content

Docker containers don't restart after server reboot #316

@mrrobot47

Description

@mrrobot47

When the host server restarts, all Frappe Manager sites and services stop working because Docker containers are not configured to restart automatically.

Problem Description

Currently, when a server (host machine) restarts:

  • All site-specific containers (frappe, nginx, socketio, schedule, redis-cache, redis-queue) remain stopped
  • Worker containers remain stopped
  • Admin tool containers (mailpit, adminer) remain stopped
  • Only global services (global-db and global-nginx-proxy) restart automatically

This results in complete service disruption after any server restart, requiring manual intervention to bring all sites and services back online.

Root Cause

The Docker Compose template files are missing the restart policy configuration for most services:

Affected Templates and Services

  1. docker-compose.tmpl (Site Services) - Missing restart policy:

    • frappe
    • nginx
    • socketio
    • schedule
    • redis-cache
    • redis-queue
  2. docker-compose.workers.tmpl (Worker Services) - Missing restart policy:

    • All worker containers
  3. docker-compose.admin-tools.tmpl (Admin Tools) - Missing restart policy:

    • mailpit
    • adminer
  4. docker-compose.services.tmpl (Global Services) - Already configured correctly:

    • global-db (has restart: always) ✓
    • global-nginx-proxy (has restart: always) ✓

Impact

Severity: High

  • Production Impact: Complete service outage after server restart
  • User Experience: All sites become unavailable until manual intervention
  • Operational Overhead: Requires manual restart of all services after every server reboot
  • Business Continuity: Server maintenance or unexpected reboots cause extended downtime

Expected Behavior

After a server restart, all Docker containers should automatically restart and restore full service functionality without manual intervention.

Proposed Solution

Add restart: unless-stopped policy to all services in the affected Docker Compose templates.

The unless-stopped policy is preferred over restart: always because:

  • Containers restart automatically after daemon/server restarts
  • Respects manual stops initiated by users (won't restart if user explicitly stopped the container)
  • Provides better control for maintenance operations

Files to Modify

  1. /frappe_manager/templates/docker-compose.tmpl
  2. /frappe_manager/templates/docker-compose.workers.tmpl
  3. /frappe_manager/templates/docker-compose.admin-tools.tmpl

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions