feat: add deploy Dockerfile, restore standalone to generic
docker/standalone/Dockerfile stays generic (port 9400, baked-in config, auth healthcheck) for anyone running tidalDB independently. docker/deploy/Dockerfile is purpose-built for k8s: port 9500, schema mounted at runtime, persistent data dir, fixed UID for PVC ownership. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3101789d32
commit
82925cee7c
31
docker/deploy/Dockerfile
Normal file
31
docker/deploy/Dockerfile
Normal file
@ -0,0 +1,31 @@
|
||||
FROM rust:1.91-slim AS builder
|
||||
WORKDIR /build
|
||||
RUN apt-get update && apt-get install -y pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy workspace manifests first for layer caching.
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
COPY tidal/Cargo.toml tidal/Cargo.toml
|
||||
COPY tidalctl/Cargo.toml tidalctl/Cargo.toml
|
||||
COPY tidal-server/Cargo.toml tidal-server/Cargo.toml
|
||||
COPY applications/forage/engine/Cargo.toml applications/forage/engine/Cargo.toml
|
||||
COPY applications/forage/server/Cargo.toml applications/forage/server/Cargo.toml
|
||||
COPY applications/forage/embedder/Cargo.toml applications/forage/embedder/Cargo.toml
|
||||
COPY applications/iknowyou/engine/Cargo.toml applications/iknowyou/engine/Cargo.toml
|
||||
|
||||
# Copy full workspace and build.
|
||||
COPY . .
|
||||
RUN cargo build -p tidal-server --release
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
|
||||
RUN useradd -m -u 10001 tidal
|
||||
COPY --from=builder --chown=tidal:tidal /build/target/release/tidal-server /usr/local/bin/tidal-server
|
||||
RUN mkdir -p /config && chown tidal:tidal /config
|
||||
USER tidal:tidal
|
||||
WORKDIR /data
|
||||
EXPOSE 9500
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
|
||||
CMD curl -sf http://localhost:9500/health || exit 1
|
||||
ENV TIDAL_SERVER_LOG=info
|
||||
ENTRYPOINT ["/usr/local/bin/tidal-server"]
|
||||
CMD ["standalone", "--listen", "0.0.0.0:9500", "--schema", "/config/eros-schema.yaml", "--data-dir", "/data"]
|
||||
@ -1,6 +1,5 @@
|
||||
FROM rust:1.91-slim AS builder
|
||||
WORKDIR /build
|
||||
RUN apt-get update && apt-get install -y pkg-config libssl-dev && rm -rf /var/lib/apt/lists/*
|
||||
FROM rust:1.91 AS builder
|
||||
WORKDIR /app
|
||||
|
||||
# Copy workspace manifests first for layer caching.
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
@ -17,15 +16,20 @@ COPY . .
|
||||
RUN cargo build -p tidal-server --release
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
|
||||
RUN useradd -m -u 10001 tidal
|
||||
COPY --from=builder --chown=tidal:tidal /build/target/release/tidal-server /usr/local/bin/tidal-server
|
||||
RUN mkdir -p /config && chown tidal:tidal /config
|
||||
USER tidal:tidal
|
||||
WORKDIR /data
|
||||
EXPOSE 9500
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=10s --retries=3 \
|
||||
CMD curl -sf http://localhost:9500/health || exit 1
|
||||
ENV TIDAL_SERVER_LOG=info
|
||||
ENTRYPOINT ["/usr/local/bin/tidal-server"]
|
||||
CMD ["standalone", "--listen", "0.0.0.0:9500", "--schema", "/config/eros-schema.yaml", "--data-dir", "/data"]
|
||||
WORKDIR /srv
|
||||
RUN useradd --system --home /srv tidal && \
|
||||
apt-get update && apt-get install -y ca-certificates curl && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=builder /app/target/release/tidal-server /usr/local/bin/tidal-server
|
||||
COPY tidal-server/config /etc/tidal-server
|
||||
|
||||
USER tidal
|
||||
EXPOSE 9400 9091
|
||||
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
||||
CMD curl -f -H "Authorization: Bearer ${TIDAL_API_KEY:-}" http://localhost:9400/health || exit 1
|
||||
|
||||
ENTRYPOINT ["tidal-server", "standalone", \
|
||||
"--listen", "0.0.0.0:9400", \
|
||||
"--metrics", "0.0.0.0:9091"]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user