fix: init

This commit is contained in:
Matteo Pietro Dazzi 2026-02-25 23:35:42 +01:00
parent 09333715a9
commit 40004af0d5
4 changed files with 10 additions and 4 deletions

View file

@ -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 --from=builder /src/build/picoclaw /usr/local/bin/picoclaw
# Copy container init scripts # 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 # Create non-root user and group
RUN addgroup -g 1000 picoclaw && \ RUN addgroup -g 1000 picoclaw && \

View file

@ -5,7 +5,7 @@ ARG TARGETPLATFORM
RUN apk add --no-cache ca-certificates tzdata RUN apk add --no-cache ca-certificates tzdata
COPY $TARGETPLATFORM/picoclaw /usr/local/bin/picoclaw 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"] ENTRYPOINT ["entrypoint"]
CMD ["gateway"] CMD ["gateway"]

View file

@ -1,3 +1,9 @@
#!/bin/sh #!/bin/sh
set -e
init && picoclaw "$@" if ! init; then
echo "Init script failed, aborting" >&2
exit 1
fi
exec picoclaw "$@"

View file

@ -1,6 +1,6 @@
configs: configs:
init_script: init_script:
file: /path/to/your/init/script file: ./container/init
services: services:
# ───────────────────────────────────────────── # ─────────────────────────────────────────────