feat: init script
This commit is contained in:
parent
c6865fe852
commit
d99dc3d0c6
5 changed files with 24 additions and 2 deletions
|
|
@ -29,6 +29,9 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
|||
# Copy binary
|
||||
COPY --from=builder /src/build/picoclaw /usr/local/bin/picoclaw
|
||||
|
||||
# Copy container init scripts
|
||||
COPY container/* /usr/local/bin/
|
||||
|
||||
# Create non-root user and group
|
||||
RUN addgroup -g 1000 picoclaw && \
|
||||
adduser -D -u 1000 -G picoclaw picoclaw
|
||||
|
|
@ -39,5 +42,5 @@ USER picoclaw
|
|||
# Run onboard to create initial directories and config
|
||||
RUN /usr/local/bin/picoclaw onboard
|
||||
|
||||
ENTRYPOINT ["picoclaw"]
|
||||
ENTRYPOINT ["entrypoint"]
|
||||
CMD ["gateway"]
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ ARG TARGETPLATFORM
|
|||
RUN apk add --no-cache ca-certificates tzdata
|
||||
|
||||
COPY $TARGETPLATFORM/picoclaw /usr/local/bin/picoclaw
|
||||
COPY container/* /usr/local/bin/
|
||||
|
||||
ENTRYPOINT ["picoclaw"]
|
||||
ENTRYPOINT ["entrypoint"]
|
||||
CMD ["gateway"]
|
||||
|
|
|
|||
3
container/entrypoint
Executable file
3
container/entrypoint
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
init && picoclaw "$@"
|
||||
3
container/init
Executable file
3
container/init
Executable file
|
|
@ -0,0 +1,3 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "No init file configured, skipping..."
|
||||
|
|
@ -1,3 +1,7 @@
|
|||
configs:
|
||||
init_script:
|
||||
file: /path/to/your/init/script
|
||||
|
||||
services:
|
||||
# ─────────────────────────────────────────────
|
||||
# PicoClaw Agent (one-shot query)
|
||||
|
|
@ -16,6 +20,10 @@ services:
|
|||
volumes:
|
||||
- ./config/config.json:/home/picoclaw/.picoclaw/config.json:ro
|
||||
- picoclaw-workspace:/home/picoclaw/.picoclaw/workspace
|
||||
configs:
|
||||
- source: init_script
|
||||
target: /usr/local/bin/init
|
||||
mode: 0777
|
||||
entrypoint: ["picoclaw", "agent"]
|
||||
stdin_open: true
|
||||
tty: true
|
||||
|
|
@ -40,6 +48,10 @@ services:
|
|||
- ./config/config.json:/home/picoclaw/.picoclaw/config.json:ro
|
||||
# Persistent workspace (sessions, memory, logs)
|
||||
- picoclaw-workspace:/home/picoclaw/.picoclaw/workspace
|
||||
configs:
|
||||
- source: init_script
|
||||
target: /usr/local/bin/init
|
||||
mode: 0777
|
||||
command: ["gateway"]
|
||||
|
||||
volumes:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue