unify dev Dockerfile and operator Dockerfile; fix the folders;

This commit is contained in:
undercover-cactus 2026-01-30 15:46:52 +01:00
parent 9278e2cd05
commit cd4e749f61
3 changed files with 10 additions and 23 deletions

View file

@ -5,8 +5,6 @@
#
# DO NOT USE for CI or production builds - use operator/Dockerfile instead.
#
# Build Args:
# DEBUG_MODE - Set to "true" to include debugging tools (default: false)
#
# Expected Binary Location:
# ./operator/target/x86_64-unknown-linux-gnu/release/datahaven-node
@ -16,16 +14,13 @@
# - librocksdb-dev for local development
# - Optional gdb, strace, vim for debugging
# - RUST_BACKTRACE enabled by default
# - Additional directories (/specs, /storage) for testing
FROM ubuntu:noble
LABEL version="0.3.0"
LABEL description="DataHaven Node - Development/CI/E2E Testing Build"
LABEL version="0.4.0"
LABEL description="DataHaven Node - Development Testing Build"
LABEL maintainer="steve@moonsonglabs.com"
ARG DEBUG_MODE=false
# Install runtime dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
@ -47,15 +42,8 @@ RUN apt-get update && \
# Create datahaven user and directories
RUN useradd -m -u 1001 -U -s /bin/sh -d /datahaven datahaven && \
mkdir -p /data /datahaven/.local/share /specs /storage && \
chown -R datahaven:datahaven /data /storage && \
ln -s /data /datahaven/.local/share/datahaven-node
# Grant sudo access if debug mode is enabled
RUN if [ "$DEBUG_MODE" = "true" ]; then \
echo "datahaven ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers && \
chmod -R 777 /storage /data; \
fi
mkdir -p /datahaven/.local/share && \
chown -R datahaven:datahaven /datahaven/.local/share
USER datahaven
@ -72,7 +60,7 @@ ENV RUST_BACKTRACE=1
# 9615: Prometheus metrics
EXPOSE 30333 9944 9615
VOLUME ["/data"]
VOLUME ["/datahaven/.local/share/datahaven-node"]
ENTRYPOINT ["datahaven-node"]
CMD ["--tmp"]

View file

@ -28,7 +28,7 @@ RUN apt-get update && \
FROM debian:stable-slim
LABEL version="0.3.0"
LABEL version="0.4.0"
LABEL description="DataHaven Node - Release Build"
LABEL maintainer="steve@moonsonglabs.com"
@ -53,9 +53,8 @@ COPY --from=builder \
# Create datahaven user and directories
RUN useradd -m -u 1001 -U -s /bin/sh -d /datahaven datahaven && \
mkdir -p /data /datahaven/.local/share /specs /storage && \
chown -R datahaven:datahaven /data /storage && \
ln -s /data /datahaven/.local/share/datahaven-node
mkdir -p /datahaven/.local/share && \
chown -R datahaven:datahaven /datahaven/.local/share
USER datahaven
@ -70,6 +69,6 @@ RUN chmod uog+x /usr/local/bin/datahaven*
# 9615: Prometheus metrics
EXPOSE 30333 9944 9615
VOLUME ["/data"]
VOLUME ["/datahaven/.local/share/datahaven-node"]
ENTRYPOINT ["/usr/local/bin/datahaven-node"]

View file

@ -124,7 +124,7 @@ export const injectStorageHubKey = async (
// Use Bun's $ directly with docker exec (no sh -c wrapper needed)
// This properly handles the spaces in the seed phrase
try {
await $`docker exec ${containerName} datahaven-node key insert --base-path /data --chain dev --key-type bcsv --scheme ecdsa --suri ${suri}`.nothrow();
await $`docker exec ${containerName} datahaven-node key insert --chain dev --key-type bcsv --scheme ecdsa --suri ${suri}`.nothrow();
logger.success(`Key ${derivation} injected successfully`);
} catch (error) {
logger.error(`Failed to inject key ${derivation}: ${error}`);