Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

[Plugin] Docker Compose Manager

Featured Replies

Just now, primeval_god said:

Its been a while since I thought about this issue, so please forgive me if my memory is a bit off. If i remember correctly the absence of a specified icon means the container gets a copy of the default question marked icon cached. I think you have to go in and remove the cached icon to force it to actually pull a new icon.

That doesn't appear to be the case, unless I'm looking in the wrong spot. I'm looking in /var/lib/docker/unraid/images and /usr/local/emhttp/state/plugins/dynamix.docker.manager/images and in each location, I only see 2 png files, that correspond to my two containers with icons.

  • Replies 872
  • Views 326.2k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • I've been playing with the code behind this plugin and have made a couple of tweaks.  I'd be interested on peoples thoughts and suggestions.   The first allows you to specify any .env file. 

  • I've recently started using Compose Manger to orchestrate my containers in Unraid. I've used docker-compose for a long time on old servers, but moved away from it when I started using Unraid, as I pre

  • In the recent update, orphaned image is now automatically removed. Thank you.   Is it possible to also update the local sha256 hash in this file /var/lib/docker/unraid-update-status.json? Si

Posted Images

Sorry, hold up. It looks like adding the label did work. It just took longer than I expected? Or maybe I failed to refresh? Will do another, but as of now it appears to be working as expected.

@primeval_god

Could you please add the option to use a global env?

It would be easier to manager in a single file things like common variables, IPs, etc

  • Author
22 hours ago, L0rdRaiden said:

@primeval_god

Could you please add the option to use a global env?

It would be easier to manager in a single file things like common variables, IPs, etc

Already exists. For each stack, click the "Edit Stack" button and then the "Settings" button and you should see an option to specify the path to the env file. You can point all your stacks at the same file. (not sure if that option is available during stack creation under the advanced dropdown, but it probably should be).

Edited by primeval_god

24 minutes ago, primeval_god said:

Already exists. For each stack, click the "Edit Stack" button and then the "Settings" button and you should see an option to specify the path to the env file. You can point all your stacks at the same file. (not sure if that option is available during stack creation under the advanced dropdown, but it probably should be).

I'm getting this error

 

.env doesn't exist: /mnt/services/docker/git/homeserver/docker-compose/

imagen.thumb.png.399b7734bb6a527e8e1d76ff61595ce1.png

 

Any idea why?

imagen.png.ebc0716f96caca062015048f14024be1.png

 

Does it replace the env file that is in the same path than the yml? or it's actually a global env? I want both files to be available to the compose project.

 

Basically if I remember well I can achieve this with

 

docker compose \
  -f /mnt/services/docker/docker-compose/Monitoring/docker-compose.yml \
  --env-file /mnt/services/docker/docker-compose/.env \  ##GLOBAL
  --env-file /mnt/services/docker/docker-compose/Monitoring/.env \  ##SPECIFIC ENV
  up -d

  • Author
36 minutes ago, L0rdRaiden said:

Does it replace the env file that is in the same path than the yml? or it's actually a global env? I want both files to be available to the compose project.

 

Basically if I remember well I can achieve this with

 

docker compose \
  -f /mnt/services/docker/docker-compose/Monitoring/docker-compose.yml \
  --env-file /mnt/services/docker/docker-compose/.env \  ##GLOBAL
  --env-file /mnt/services/docker/docker-compose/Monitoring/.env \  ##SPECIFIC ENV
  up -d

At this time it only supports a single env file.

 

36 minutes ago, L0rdRaiden said:

I'm getting this error

 

.env doesn't exist: /mnt/services/docker/git/homeserver/docker-compose/

imagen.thumb.png.399b7734bb6a527e8e1d76ff61595ce1.png

 

Any idea why?

I dont remember off hand if the path is to the folder that contains the .env or if it expects a path directly to the .env file. Try both.

Edited by primeval_god

1 hour ago, primeval_god said:

At this time it only supports a single env file.

 

I dont remember off hand if the path is to the folder that contains the .env or if it expects a path directly to the .env file. Try both.

 

And could you please consider to implement the concept of global env in combination with the "local" one?

 

You could add the setting here for the global path env

imagen.thumb.png.f5c8797f47fef2f1dfb466abad18f793.png

 

And then modify the code to run both env files in case the global one exist.

 

 

This is the script I use to launch after array start, the problem is that isn't "compatible" with compose manager since I can't use a global env

 


 

#!/bin/bash

# Exit on error, unset variables, and pipefail
set -eo pipefail

sleep 10

echo "⏹️ Checking running containers..."
running_containers=$(docker ps -q)

if [ -n "$running_containers" ]; then
  echo "⏹️ Stopping all running containers..."
  docker stop $running_containers
  echo " Containers stopped successfully."
else
  echo " No running containers."
fi

echo ""

# Base path for docker-compose files
base_path="/mnt/services/docker/git/homeserver/docker-compose"

# Path to the global .env file
global_env_file="$base_path/.env"

# Check if global .env exists
if [ ! -f "$global_env_file" ]; then
  echo "⚠️ Global .env file not found at $global_env_file — proceeding anyway."
fi

# Function to parse .env file into an associative array
parse_env_file() {
  local file=$1
  declare -n env_map=$2 # Use -g if you need it globally, but local nameref is good here

  # Read only lines that are not comments and contain an equals sign
  while IFS='=' read -r key value || [[ -n "$key" ]]; do
    # Basic sanitization of key, skip if key is empty after read
    key=$(echo "$key" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
    if [[ -z "$key" ]]; then
      continue
    fi

    # Trim spaces from value
    value=$(echo "$value" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')

    # Remove quotes if present (handles simple cases)
    value="${value#\"}"; value="${value%\"}"
    value="${value#\'}"; value="${value%\'}"

    env_map["$key"]="$value"
  done < <(grep -Ev '^[[:space:]]*#|^[[:space:]]*$' "$file" | grep '=')
}

# List of services with their delay in seconds (format: "service:delay")
services_with_delays=(
  "adguardhome5:0"
  "adguardhome6:0"
  "administration:0"
  "komodo:0"
  "homeautomation:0"
  "media:0"
  "webproxyint:60"
  "safeline:30"
  "webproxydmz:0"
  "monitoring:0"
  "backup:0"
  #"portainer:10"
  #"dockge:10"
  #"immich:10"
)

# List of containers to stop at the end
containers_to_stop=(
  "Netdata"
)

# Start services with delays
for entry in "${services_with_delays[@]}"; do
  IFS=":" read -r service delay <<< "$entry"
  
  compose_file="$base_path/$service/docker-compose.yml"
  local_env_file="$base_path/$service/.env"
  
  echo ""
  echo "🚀 Starting service: $service"

  # Check if the docker-compose file exists
  if [ ! -f "$compose_file" ]; then
    echo " Compose file not found for $service at $compose_file. Skipping."
    continue
  fi

  # Check for env file collisions
  if [ -f "$global_env_file" ] && [ -f "$local_env_file" ]; then
    declare -A global_vars
    declare -A local_vars

    parse_env_file "$global_env_file" global_vars
    parse_env_file "$local_env_file" local_vars

    for key in "${!global_vars[@]}"; do
      if [[ -n "${local_vars[$key]}" ]]; then
        echo "⚠️ Variable override detected for '$key'"
        echo "   🌐 Global value: ${global_vars[$key]}"
        echo "   📁 Local value:  ${local_vars[$key]}"
      fi
    done
  fi

  # Build docker compose command arguments
  compose_cmd_args=("-f" "$compose_file")

  # Add global .env file if it exists
  if [ -f "$global_env_file" ]; then
    compose_cmd_args+=("--env-file" "$global_env_file")
  fi

  # Add local .env file if it exists
  if [ -f "$local_env_file" ]; then
    compose_cmd_args+=("--env-file" "$local_env_file")
  fi

  # Run docker compose with the accumulated arguments
  compose_cmd_args+=("up" "-d")

  echo "🐳 Executing: docker compose ${compose_cmd_args[*]}"
  if docker compose "${compose_cmd_args[@]}"; then
    echo " Service $service started successfully."
  else
    echo " Failed to start service $service. Check output above."
    # Consider 'exit 1' or other error handling if a service fails to start
  fi

  echo " Waiting $delay seconds..."
  sleep "$delay"
done

echo ""
echo " All services have been started in order."
echo ""

# Stop specific containers at the end of the process
echo "🛑 Stopping specific containers at the end of the process..."
for container in "${containers_to_stop[@]}"; do
  if docker ps -q -f name="^${container}$" > /dev/null; then
    docker stop "$container"
    echo " Container stopped: $container"
  else
    echo "ℹ️ Container not running or not found: $container"
  fi
done

echo ""
echo "🏁 Process completed."

 

Edited by L0rdRaiden

9 hours ago, L0rdRaiden said:

 

And could you please consider to implement the concept of global env in combination with the "local" one?

 

You could add the setting here for the global path env

imagen.thumb.png.f5c8797f47fef2f1dfb466abad18f793.png

 

And then modify the code to run both env files in case the global one exist.

 

 

This is the script I use to launch after array start, the problem is that isn't "compatible" with compose manager since I can't use a global env

 


 

#!/bin/bash

# Exit on error, unset variables, and pipefail
set -eo pipefail

sleep 10

echo "⏹️ Checking running containers..."
running_containers=$(docker ps -q)

if [ -n "$running_containers" ]; then
  echo "⏹️ Stopping all running containers..."
  docker stop $running_containers
  echo " Containers stopped successfully."
else
  echo " No running containers."
fi

echo ""

# Base path for docker-compose files
base_path="/mnt/services/docker/git/homeserver/docker-compose"

# Path to the global .env file
global_env_file="$base_path/.env"

# Check if global .env exists
if [ ! -f "$global_env_file" ]; then
  echo "⚠️ Global .env file not found at $global_env_file — proceeding anyway."
fi

# Function to parse .env file into an associative array
parse_env_file() {
  local file=$1
  declare -n env_map=$2 # Use -g if you need it globally, but local nameref is good here

  # Read only lines that are not comments and contain an equals sign
  while IFS='=' read -r key value || [[ -n "$key" ]]; do
    # Basic sanitization of key, skip if key is empty after read
    key=$(echo "$key" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')
    if [[ -z "$key" ]]; then
      continue
    fi

    # Trim spaces from value
    value=$(echo "$value" | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')

    # Remove quotes if present (handles simple cases)
    value="${value#\"}"; value="${value%\"}"
    value="${value#\'}"; value="${value%\'}"

    env_map["$key"]="$value"
  done < <(grep -Ev '^[[:space:]]*#|^[[:space:]]*$' "$file" | grep '=')
}

# List of services with their delay in seconds (format: "service:delay")
services_with_delays=(
  "adguardhome5:0"
  "adguardhome6:0"
  "administration:0"
  "komodo:0"
  "homeautomation:0"
  "media:0"
  "webproxyint:60"
  "safeline:30"
  "webproxydmz:0"
  "monitoring:0"
  "backup:0"
  #"portainer:10"
  #"dockge:10"
  #"immich:10"
)

# List of containers to stop at the end
containers_to_stop=(
  "Netdata"
)

# Start services with delays
for entry in "${services_with_delays[@]}"; do
  IFS=":" read -r service delay <<< "$entry"
  
  compose_file="$base_path/$service/docker-compose.yml"
  local_env_file="$base_path/$service/.env"
  
  echo ""
  echo "🚀 Starting service: $service"

  # Check if the docker-compose file exists
  if [ ! -f "$compose_file" ]; then
    echo " Compose file not found for $service at $compose_file. Skipping."
    continue
  fi

  # Check for env file collisions
  if [ -f "$global_env_file" ] && [ -f "$local_env_file" ]; then
    declare -A global_vars
    declare -A local_vars

    parse_env_file "$global_env_file" global_vars
    parse_env_file "$local_env_file" local_vars

    for key in "${!global_vars[@]}"; do
      if [[ -n "${local_vars[$key]}" ]]; then
        echo "⚠️ Variable override detected for '$key'"
        echo "   🌐 Global value: ${global_vars[$key]}"
        echo "   📁 Local value:  ${local_vars[$key]}"
      fi
    done
  fi

  # Build docker compose command arguments
  compose_cmd_args=("-f" "$compose_file")

  # Add global .env file if it exists
  if [ -f "$global_env_file" ]; then
    compose_cmd_args+=("--env-file" "$global_env_file")
  fi

  # Add local .env file if it exists
  if [ -f "$local_env_file" ]; then
    compose_cmd_args+=("--env-file" "$local_env_file")
  fi

  # Run docker compose with the accumulated arguments
  compose_cmd_args+=("up" "-d")

  echo "🐳 Executing: docker compose ${compose_cmd_args[*]}"
  if docker compose "${compose_cmd_args[@]}"; then
    echo " Service $service started successfully."
  else
    echo " Failed to start service $service. Check output above."
    # Consider 'exit 1' or other error handling if a service fails to start
  fi

  echo " Waiting $delay seconds..."
  sleep "$delay"
done

echo ""
echo " All services have been started in order."
echo ""

# Stop specific containers at the end of the process
echo "🛑 Stopping specific containers at the end of the process..."
for container in "${containers_to_stop[@]}"; do
  if docker ps -q -f name="^${container}$" > /dev/null; then
    docker stop "$container"
    echo " Container stopped: $container"
  else
    echo "ℹ️ Container not running or not found: $container"
  fi
done

echo ""
echo "🏁 Process completed."

 


as example with netbox:

you can gitclone the repo
https://github.com/netbox-community/netbox-docker/blob/release/docker-compose.yml

advance set the compse file and teh compse file can set env file...
 

services:
  netbox: &netbox
    image: docker.io/netboxcommunity/netbox:${VERSION-v4.3-3.3.0}
    depends_on:
      - postgres
      - redis
      - redis-cache
    env_file: env/netbox.env


while not global if can make for host mount paths to other compse related env files...

I cannot find this when searching, however I cannot determine why this is occurring my paperless-ngx stack. When creating the compose file, environment, etc. in the Unraid GUI and selecting compose up, I do not get an output when running docker compose ps

Any reasoning or ideas as to why?

Image showing that paperless-ngx is running by the Unraid GUI, but not appearing when running the docker compose ps command.

image.png

  • Author
14 hours ago, Joly0 said:

Hey @primeval_god could you take a look into my pr https://github.com/dcflachs/compose_plugin/pull/33 and maybe merge it? Would be great to have this implemented. Currently i have to apply my changes manually after reboots on one of my servers

Part of your issue appears to be that you are putting foreign files in the compose manager project directory. That directory should only contain files created by the plugin itself. If you are using the plugin with a pre-existing compose stack, it should be saved elsewhere on your system and "Indirect" option used to point the plugin to its location.

3 hours ago, primeval_god said:

Part of your issue appears to be that you are putting foreign files in the compose manager project directory. That directory should only contain files created by the plugin itself. If you are using the plugin with a pre-existing compose stack, it should be saved elsewhere on your system and "Indirect" option used to point the plugin to its location.

Ähh, no. For example i cloned the perplexica github repo to my array, not the compose manager project directory. I created a new stack on the compose page and pointed the stack directory to the cloned repo directory. Still the compose file that perplexica ships with is not showing up in the compose manager page, because the plugin expects the file with a the name "docker-compose.yml", perplexica uses "docker-compose.yaml". My patch fixes this.

See here the perplexica path without my patch:
grafik.pnggrafik.pnggrafik.pnggrafik.png

As you can see, the stack and the project files are correct, just the plugin expects an docker-compose.yml file, while perplexica ships a file named "docker-compose.yaml".

  • Author
10 minutes ago, Joly0 said:

See here the perplexica path without my patch:
grafik.pnggrafik.pnggrafik.pnggrafik.png

As you can see, the stack and the project files are correct, just the plugin expects an docker-compose.yml file, while perplexica ships a file named "docker-compose.yaml".

Yes the file wont be editable in the gui but the stack should still start and stop correctly.

35 minutes ago, primeval_god said:

Yes the file wont be editable in the gui but the stack should still start and stop correctly.

No, it doesnt:
grafik.png

So, can you merge my PR please?

image.png

image.png

i am using the docker compose plugin to run the lublogger container. whenever i update stack i get the above error and it leaves and orphan image.

any idea why this happens or how i can correct? please and thank you, i appreciate any help!

  • Author
5 hours ago, Joly0 said:

So, can you merge my PR please?

I wont have a chance to review it until after the holiday weekend at the earliest.

  • Author
5 minutes ago, knights_of_pine said:

image.png

image.png

i am using the docker compose plugin to run the lublogger container. whenever i update stack i get the above error and it leaves and orphan image.

any idea why this happens or how i can correct? please and thank you, i appreciate any help!

Maybe something wrong with a build statement in the compose file or the dockerfile it references? This seems likely to be an issue with the stack rather than the compose plugin. This thread is for plugin support not support for stacks in general.

44 minutes ago, primeval_god said:

Maybe something wrong with a build statement in the compose file or the dockerfile it references? This seems likely to be an issue with the stack rather than the compose plugin. This thread is for plugin support not support for stacks in general.

sorry im new to this... when you say something wrong with the stack do you mean the actual compose file i am using?

  • Author
23 minutes ago, knights_of_pine said:

sorry im new to this... when you say something wrong with the stack do you mean the actual compose file i am using?

Yes the compose file or any additional files that it includes or references.

Is the code for this plugin available somewhere for people to contribute? If not I'd like to see some sort of git integration with the plugin.

i.e. allow the plug to pull compose files from an external source like git for instance. The ability to push changes upstream to a git repo would be nice as well.

  • Author
1 hour ago, sudoluke said:

Is the code for this plugin available somewhere for people to contribute? If not I'd like to see some sort of git integration with the plugin.

i.e. allow the plug to pull compose files from an external source like git for instance. The ability to push changes upstream to a git repo would be nice as well.

No such integration is planned. Adding git integration encourages pulling complex stacks made and maintained by external projects. The purpose of this plugin is managing simple stacks created via the plugin web interface.

Up until recently, i mounted my cifs/samba shares to the host via unassigned devices. I then noticed that the docker-compose gui was not showing the smb volumes i was mounting in my compose file. It used to, but it no longer does. Has anyone else seen this? I tried doing a top level named volume and map the the volumes per container like this:

volumes: 
  seed-volume:
    driver_opts:
      type: cifs 
      o: username=u,password=p,uid=uid,gid=guid,vers=3.0
      device: //[host]/media

and then:

      - type: volume
        source: seed-volume
        target: /media/frigate
        volume:
          subpath: recordings/frigate

And while this works and i can exec into the container and see the mount points are correct, the gui for docker-compose and docker in unraid do not show those volumes in the ui:

image.png

Is this a known issue or a bug that has crept in?

  • Author
2 hours ago, DS18 said:

And while this works and i can exec into the container and see the mount points are correct, the gui for docker-compose and docker in unraid do not show those volumes in the ui:

image.png

Is this a known issue or a bug that has crept in?

Never tried such a thing but this is not a function of the compose plugin ui. The snippet you show above is the Dockerman ui which is built into unraid.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.