Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions apps/website/public/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,18 @@ install_dokploy() {
$endpoint_mode \
postgres:16

redis_args="redis-server"
if [ -n "$REDIS_HZ" ]; then
redis_args="redis-server --hz $REDIS_HZ --dynamic-hz yes"
fi

docker service create \
--name dokploy-redis \
--constraint 'node.role==manager' \
--network dokploy-network \
--mount type=volume,source=dokploy-redis,target=/data \
$endpoint_mode \
redis:7
redis:7 $redis_args

# Installation
# Set RELEASE_TAG environment variable for canary/feature versions
Expand All @@ -268,6 +273,17 @@ install_dokploy() {
# canary, feature/*, etc. → use the tag as-is
release_tag_env="-e RELEASE_TAG=$VERSION_TAG"
fi

HEALTH_EXTRA_OPTS=""
if [ "$HEALTH_CMD" = "none" ]; then
HEALTH_EXTRA_OPTS="$HEALTH_EXTRA_OPTS --no-healthcheck"
Comment thread
naturedamends marked this conversation as resolved.
elif [ -n "$HEALTH_CMD" ]; then
HEALTH_EXTRA_OPTS="$HEALTH_EXTRA_OPTS --health-cmd $HEALTH_CMD"
fi
[ -n "$HEALTH_INTERVAL" ] && HEALTH_EXTRA_OPTS="$HEALTH_EXTRA_OPTS --health-interval $HEALTH_INTERVAL"
[ -n "$HEALTH_TIMEOUT" ] && HEALTH_EXTRA_OPTS="$HEALTH_EXTRA_OPTS --health-timeout $HEALTH_TIMEOUT"
[ -n "$HEALTH_RETRIES" ] && HEALTH_EXTRA_OPTS="$HEALTH_EXTRA_OPTS --health-retries $HEALTH_RETRIES"
[ -n "$HEALTH_START_PERIOD" ] && HEALTH_EXTRA_OPTS="$HEALTH_EXTRA_OPTS --health-start-period $HEALTH_START_PERIOD"
Comment on lines +278 to +286
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 --no-healthcheck combined with health timing flags causes a Docker error

When HEALTH_CMD=none is set alongside any timing variable (e.g. HEALTH_INTERVAL=30s), the resulting flags are --no-healthcheck --health-interval 30s. Docker rejects this combination — --no-healthcheck and --health-* options are mutually exclusive. The health timing checks on lines 283-286 run unconditionally, so the conflict can arise silently from a plausible user configuration.

Add a guard so timing options are only appended when HEALTH_CMD is not "none":

HEALTH_EXTRA_OPTS=""
if [ "$HEALTH_CMD" = "none" ]; then
    HEALTH_EXTRA_OPTS="--no-healthcheck"
else
    if [ -n "$HEALTH_CMD" ]; then
        HEALTH_EXTRA_OPTS="$HEALTH_EXTRA_OPTS --health-cmd $HEALTH_CMD"
    fi
    [ -n "$HEALTH_INTERVAL" ]    && HEALTH_EXTRA_OPTS="$HEALTH_EXTRA_OPTS --health-interval $HEALTH_INTERVAL"
    [ -n "$HEALTH_TIMEOUT" ]     && HEALTH_EXTRA_OPTS="$HEALTH_EXTRA_OPTS --health-timeout $HEALTH_TIMEOUT"
    [ -n "$HEALTH_RETRIES" ]     && HEALTH_EXTRA_OPTS="$HEALTH_EXTRA_OPTS --health-retries $HEALTH_RETRIES"
    [ -n "$HEALTH_START_PERIOD" ] && HEALTH_EXTRA_OPTS="$HEALTH_EXTRA_OPTS --health-start-period $HEALTH_START_PERIOD"
fi


docker service create \
--name dokploy \
Expand All @@ -281,6 +297,7 @@ install_dokploy() {
--update-parallelism 1 \
--update-order stop-first \
--constraint 'node.role == manager' \
$HEALTH_EXTRA_OPTS \
$endpoint_mode \
$release_tag_env \
-e ADVERTISE_ADDR=$advertise_addr \
Expand Down Expand Up @@ -361,4 +378,4 @@ if [ "$1" = "update" ]; then
update_dokploy
else
install_dokploy
fi
fi