···33333434WORKDIR /app
35353636-# Copy binary from builder
3636+# Copy binary and entrypoint from builder
3737COPY --from=builder /build/brooke-spin /app/brooke-spin
3838+COPY entrypoint.sh /app/entrypoint.sh
38393939-# Create data directory
4040-RUN mkdir -p /app/data && chown -R brooke:brooke /app
4040+# Set ownership and make entrypoint executable
4141+RUN chown -R brooke:brooke /app && \
4242+ chmod +x /app/entrypoint.sh
41434244# Switch to non-root user
4345USER brooke
4646+4747+# Use entrypoint to ensure data directory exists
4848+ENTRYPOINT ["/app/entrypoint.sh"]
44494550# Default command
4651CMD ["/app/brooke-spin", "-config", "/app/config.yaml"]
+1-1
config.example.yaml
···34343535 # Path to state file (SQLite database or JSON file)
3636 # This file tracks which notifications have been processed
3737- path: "./data/state.db"
3737+ path: "/data/state.db"
+1-1
docker-compose.yml
···1111 # Mount configuration and data
1212 volumes:
1313 - ./config.yaml:/app/config.yaml:ro
1414- - ./data:/app/data
1414+ - ./data:/data
15151616 # Environment variables (optional, overrides config.yaml)
1717 environment:
+8
entrypoint.sh
···11+#!/bin/sh
22+set -e
33+44+# Ensure data directory exists and is writable
55+mkdir -p /data
66+77+# Execute the main command
88+exec "$@"