feat: expand Docker build to all features, add docker-compose.yml

- Build with server, mcp, swagger, client, tls features (all except magic)
- Add KEEP_* environment variable documentation and defaults
- Copy CA certificates for HTTPS client support in scratch image
- Add docker-compose.yml with keep-data and keep-config volumes
This commit is contained in:
2026-03-13 10:08:28 -03:00
parent d5d58bc52c
commit af1e0ca570
2 changed files with 54 additions and 1 deletions

View File

@@ -23,14 +23,40 @@ RUN cargo fetch --target x86_64-unknown-linux-musl
# magic feature excluded (requires shared libmagic; fallback uses `file` command) # magic feature excluded (requires shared libmagic; fallback uses `file` command)
COPY src/ src/ COPY src/ src/
RUN cargo build --release --target x86_64-unknown-linux-musl \ RUN cargo build --release --target x86_64-unknown-linux-musl \
--no-default-features --features lz4,gzip \ --no-default-features --features lz4,gzip,server,mcp,swagger,client,tls \
&& strip target/x86_64-unknown-linux-musl/release/keep && strip target/x86_64-unknown-linux-musl/release/keep
# Runtime stage - scratch since binary is fully static # Runtime stage - scratch since binary is fully static
FROM scratch FROM scratch
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/keep /keep COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/keep /keep
COPY --from=builder /etc/ssl/certs/ /etc/ssl/certs/
EXPOSE 21080 EXPOSE 21080
# General options
# ENV KEEP_CONFIG=/config/config.yml
# Mount a volume for persistent storage: -v keep-data:/data
ENV KEEP_DIR=/data
ENV KEEP_LIST_FORMAT="id,time,size,tags,meta:hostname"
# Item options
# ENV KEEP_COMPRESSION=lz4
# ENV KEEP_META_PLUGINS=""
# ENV KEEP_FILTERS=""
# Server options
ENV KEEP_SERVER_ADDRESS=0.0.0.0
ENV KEEP_SERVER_PORT=21080
# ENV KEEP_SERVER_PASSWORD=""
# ENV KEEP_SERVER_PASSWORD_HASH=""
# TLS options
# ENV KEEP_SERVER_CERT=/certs/cert.pem
# ENV KEEP_SERVER_KEY=/certs/key.pem
# Client options
# ENV KEEP_CLIENT_URL=""
# ENV KEEP_CLIENT_PASSWORD=""
ENTRYPOINT ["/keep"] ENTRYPOINT ["/keep"]

27
docker-compose.yml Normal file
View File

@@ -0,0 +1,27 @@
services:
keep:
build: .
ports:
- "21080:21080"
volumes:
- keep-data:/data
- keep-config:/config
environment:
- KEEP_SERVER_ADDRESS=0.0.0.0
- KEEP_SERVER_PORT=21080
# - KEEP_SERVER_PASSWORD=changeme
# - KEEP_SERVER_PASSWORD_HASH=
# - KEEP_COMPRESSION=lz4
# - KEEP_META_PLUGINS=
# - KEEP_FILTERS=
- KEEP_CONFIG=/config/config.yml
# - KEEP_SERVER_CERT=/certs/cert.pem
# - KEEP_SERVER_KEY=/certs/key.pem
restart: unless-stopped
# For TLS, mount certificate files:
# volumes:
# - ./certs:/certs:ro
volumes:
keep-data:
keep-config: