From ae7b5a58e39a7f2dd0c5fc520a31da845e9eeb1f Mon Sep 17 00:00:00 2001 From: "Gregory N. Schmit" Date: Sun, 31 Mar 2024 11:15:54 -0500 Subject: [PATCH] Try to fix reboot loop issue with entrypoint. --- Dockerfile | 1 + bin/entrypoint.sh | 7 +++++++ 2 files changed, 8 insertions(+) create mode 100755 bin/entrypoint.sh diff --git a/Dockerfile b/Dockerfile index ad4c36f..1b57c40 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,4 +28,5 @@ COPY --from=build /usr/local/bundle /usr/local/bundle COPY --from=build /app /app EXPOSE 3000 +ENTRYPOINT ["bin/entrypoint.sh"] CMD ["bin/rails", "server"] diff --git a/bin/entrypoint.sh b/bin/entrypoint.sh new file mode 100755 index 0000000..fcd77e1 --- /dev/null +++ b/bin/entrypoint.sh @@ -0,0 +1,7 @@ +#!/bin/sh -e + +# Fix reboot loop issue (`A server is already running. Check +# /app/test/tmp/pids/server.pid.`). +rm -rf /app/test/tmp/pids/server.pid + +exec "$@"