Skip to content

Commit b7da835

Browse files
authored
fix: fix dify-plugin-daemon is pid 1 (#710)
1 parent c06646b commit b7da835

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

docker/local.dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y curl python3.12 \
4242
python3.12-venv python3.12-dev python3-pip ffmpeg \
4343
build-essential git \
4444
cmake pkg-config \
45-
libcairo2-dev libjpeg-dev libgif-dev
45+
libcairo2-dev libjpeg-dev libgif-dev \
46+
tini
4647

4748
apt-get clean
4849
rm -rf /var/lib/apt/lists/*
@@ -74,5 +75,10 @@ ENV GIN_MODE=release
7475

7576
COPY --from=builder /app/main /app/commandline /app/
7677

78+
# Use tini as PID 1 so that /app/main is NOT PID 1 inside the container.
79+
# The Python plugin SDK self-destructs (os._exit(-1), exit 255) when its
80+
# parent process is PID 1, because it treats that as an "orphaned" state.
81+
ENTRYPOINT ["/usr/bin/tini", "-g", "--"]
82+
7783
# run migrate then start the server
7884
CMD ["/bin/bash", "-c", "/app/commandline migrate && exec /app/main"]

0 commit comments

Comments
 (0)