From 40004af0d545cec3d8db1c5a4d217f859091c7b2 Mon Sep 17 00:00:00 2001 From: Matteo Pietro Dazzi Date: Wed, 25 Feb 2026 23:35:42 +0100 Subject: [PATCH] fix: init --- Dockerfile | 2 +- Dockerfile.goreleaser | 2 +- container/entrypoint | 8 +++++++- docker-compose.yml | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ff83da33e..c0cc5c7ce 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \ COPY --from=builder /src/build/picoclaw /usr/local/bin/picoclaw # Copy container init scripts -COPY --chmod=0755 container/* /usr/local/bin/ +COPY --chmod=0755 container/entrypoint container/init /usr/local/bin/ # Create non-root user and group RUN addgroup -g 1000 picoclaw && \ diff --git a/Dockerfile.goreleaser b/Dockerfile.goreleaser index 6adcef1aa..cab71b16f 100644 --- a/Dockerfile.goreleaser +++ b/Dockerfile.goreleaser @@ -5,7 +5,7 @@ ARG TARGETPLATFORM RUN apk add --no-cache ca-certificates tzdata COPY $TARGETPLATFORM/picoclaw /usr/local/bin/picoclaw -COPY --chmod=0755 container/* /usr/local/bin/ +COPY --chmod=0755 container/entrypoint container/init /usr/local/bin/ ENTRYPOINT ["entrypoint"] CMD ["gateway"] diff --git a/container/entrypoint b/container/entrypoint index 5d5a21c97..0f30ba79e 100755 --- a/container/entrypoint +++ b/container/entrypoint @@ -1,3 +1,9 @@ #!/bin/sh +set -e -init && picoclaw "$@" +if ! init; then + echo "Init script failed, aborting" >&2 + exit 1 +fi + +exec picoclaw "$@" diff --git a/docker-compose.yml b/docker-compose.yml index 471e00f48..8a910c9d8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ configs: init_script: - file: /path/to/your/init/script + file: ./container/init services: # ─────────────────────────────────────────────