Skip to content
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ EXPOSE 3000 8080 8081 7681
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=3 \
CMD curl -f http://localhost:3000/health || exit 1

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
ENTRYPOINT ["/init", "/usr/local/bin/entrypoint.sh"]
CMD ["gateway", "run"]
17 changes: 4 additions & 13 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/command/with-contenv bash
# DAppNode Hermes Agent entrypoint
# Based on upstream docker/entrypoint.sh (v2026.5.7) with DAppNode additions.
set -e
Expand Down Expand Up @@ -86,14 +86,6 @@ if [ "$(id -u)" = "0" ]; then
drop_to_hermes "$@"
fi

# If this script is PID 1 after the privilege drop, insert tini while still
# running as `hermes`. That keeps signal forwarding/zombie reaping without
# making the setup wizard signal a root-owned PID 1 on restart.
if [ "${DAPPNODE_TINI_WRAPPED:-}" != "1" ] && [ "$$" = "1" ] && command -v tini >/dev/null 2>&1; then
export DAPPNODE_TINI_WRAPPED=1
exec tini -g -- "$0" "$@"
fi

# --- Running as hermes from here ---
export HOME="$HERMES_HOME/home"
export USER="${USER:-hermes}"
Expand All @@ -108,14 +100,13 @@ rm -f "$HERMES_HOME"/gateway.lock "$HERMES_HOME"/gateway.pid
# --- Bootstrap config files (mirrors upstream entrypoint) ---
mkdir -p "$HERMES_HOME"/{cron,sessions,logs,hooks,memories,skills,skins,plans,workspace,home}

if [ ! -f "$HERMES_HOME/.env" ]; then
if [ ! -f "$HERMES_HOME/.env" ] && [ -f "$INSTALL_DIR/.env.example" ]; then
cp "$INSTALL_DIR/.env.example" "$HERMES_HOME/.env"
fi
if [ ! -f "$HERMES_HOME/config.yaml" ]; then
if [ ! -f "$HERMES_HOME/config.yaml" ] && [ -f "$INSTALL_DIR/cli-config.yaml.example" ]; then
cp "$INSTALL_DIR/cli-config.yaml.example" "$HERMES_HOME/config.yaml"
fi

if [ ! -f "$HERMES_HOME/SOUL.md" ]; then
if [ ! -f "$HERMES_HOME/SOUL.md" ] && [ -f "$INSTALL_DIR/docker/SOUL.md" ]; then
cp "$INSTALL_DIR/docker/SOUL.md" "$HERMES_HOME/SOUL.md"
fi

Expand Down
Loading