fix(docker): fix dockerfiles to properly build images

This commit is contained in:
Daniil Polyakov 2026-06-23 14:29:23 +03:00
parent 4d7e994e0b
commit 972a7f981b
12 changed files with 44 additions and 27 deletions

View File

@ -59,10 +59,10 @@ run-indexer mock="":
@echo "🔍 Running indexer"
@if [ "{{mock}}" = "mock" ]; then \
echo "🧪 Using mock data"; \
RUST_LOG=info cargo run --release --features mock-responses -p indexer_service configs/indexer_config.json; \
RUST_LOG=info cargo run --release --features mock-responses -p indexer_service configs/debug/indexer_config.json; \
else \
echo "🚀 Using real data"; \
RUST_LOG=info cargo run --release -p indexer_service configs/indexer_config.json; \
RUST_LOG=info cargo run --release -p indexer_service configs/debug/indexer_config.json; \
fi
# Run Explorer.

View File

@ -156,7 +156,7 @@ The sequencer and logos blockchain node can be run locally:
- `docker compose up`
2. On another terminal go to the `logos-blockchain/logos-execution-zone` repo and run indexer service:
- `RUST_LOG=info cargo run -p indexer_service lez/indexer/service/configs/indexer_config.json`
- `RUST_LOG=info cargo run -p indexer_service lez/indexer/service/configs/debug/indexer_config.json`
3. On another terminal go to the `logos-blockchain/logos-execution-zone` repo and run the sequencer:
- `RUST_LOG=info cargo run -p sequencer_service lez/sequencer/service/configs/debug/sequencer_config.json`

View File

@ -13,7 +13,6 @@
"channel_id": "0101010101010101010101010101010101010101010101010101010101010101",
"node_url": "http://logos-blockchain-node-0:18080"
},
"indexer_rpc_url": "ws://indexer_service:8779",
"genesis": [
{
"supply_bridge_account": {

View File

@ -2,10 +2,10 @@ services:
explorer_service:
image: lez/explorer_service
build:
context: ..
dockerfile: explorer_service/Dockerfile
context: ../..
dockerfile: lez/explorer_service/Dockerfile
container_name: explorer_service
environment:
INDEXER_RPC_URL: ${INDEXER_RPC_URL:-http://localhost:8779}
INDEXER_RPC_URL: ${INDEXER_RPC_URL:-http://host.docker.internal:8779}
ports:
- "8080:8080"
- "8081:8080"

View File

@ -11,6 +11,7 @@ RUN apt-get update && apt-get install -y \
cmake \
ninja-build \
curl \
unzip \
git \
&& rm -rf /var/lib/apt/lists/*
@ -26,11 +27,11 @@ RUN ARCH=$(uname -m); \
else \
echo "Using manual build for $ARCH"; \
git clone --depth 1 --branch release-3.0 https://github.com/risc0/risc0.git; \
git clone --depth 1 --branch r0.1.91.1 https://github.com/risc0/rust.git; \
git clone --depth 1 --branch risc0-1.94.1 https://github.com/risc0/rust.git; \
cd /risc0; \
cargo install --path rzup; \
cargo install --locked --path rzup; \
rzup build --path /rust rust --verbose; \
cargo install --path risc0/cargo-risczero; \
cargo install --locked --path risc0/cargo-risczero; \
fi
ENV PATH="/root/.cargo/bin:/root/.risc0/bin:${PATH}"
RUN cp "$(which r0vm)" /usr/local/bin/r0vm
@ -69,6 +70,11 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry/index \
# Runtime stage - minimal image
FROM debian:trixie-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user for security
RUN useradd -m -u 1000 -s /bin/bash indexer_service_user && \
mkdir -p /indexer_service /etc/indexer_service /var/lib/indexer_service && \

View File

@ -5,4 +5,4 @@
"addr": "http://localhost:8080"
},
"channel_id": "0101010101010101010101010101010101010101010101010101010101010101"
}
}

View File

@ -0,0 +1,8 @@
{
"home": ".",
"consensus_info_polling_interval": "1s",
"bedrock_config": {
"addr": "http://host.docker.internal:8080"
},
"channel_id": "0101010101010101010101010101010101010101010101010101010101010101"
}

View File

@ -2,14 +2,14 @@ services:
indexer_service:
image: lez/indexer_service
build:
context: ../..
context: ../../..
dockerfile: lez/indexer/service/Dockerfile
container_name: indexer_service
ports:
- "8779:8779"
volumes:
# Mount configuration
- ./configs/indexer_config.json:/etc/indexer_service/indexer_config.json
- ./configs/docker/indexer_config.json:/etc/indexer_service/indexer_config.json
# Mount data volume
- indexer_data:/var/lib/indexer_service

View File

@ -11,6 +11,7 @@ RUN apt-get update && apt-get install -y \
cmake \
ninja-build \
curl \
unzip \
git \
&& rm -rf /var/lib/apt/lists/*
@ -26,11 +27,11 @@ RUN ARCH=$(uname -m); \
else \
echo "Using manual build for $ARCH"; \
git clone --depth 1 --branch release-3.0 https://github.com/risc0/risc0.git; \
git clone --depth 1 --branch r0.1.91.0 https://github.com/risc0/rust.git; \
git clone --depth 1 --branch risc0-1.94.1 https://github.com/risc0/rust.git; \
cd /risc0; \
cargo install --path rzup; \
cargo install --locked --path rzup; \
rzup build --path /rust rust --verbose; \
cargo install --path risc0/cargo-risczero; \
cargo install --locked --path risc0/cargo-risczero; \
fi
ENV PATH="/root/.cargo/bin:/root/.risc0/bin:${PATH}"
RUN cp "$(which r0vm)" /usr/local/bin/r0vm
@ -81,16 +82,21 @@ RUN --mount=type=cache,target=/usr/local/cargo/registry/index \
# Runtime stage - minimal image
FROM debian:trixie-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y \
curl \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user for security
RUN useradd -m -u 1000 -s /bin/bash sequencer_user && \
RUN useradd -m -u 1000 -s /bin/bash sequencer_service_user && \
mkdir -p /sequencer_service /etc/sequencer_service /var/lib/sequencer_service && \
chown -R sequencer_user:sequencer_user /sequencer_service /etc/sequencer_service /var/lib/sequencer_service
chown -R sequencer_service_user:sequencer_service_user /sequencer_service /etc/sequencer_service /var/lib/sequencer_service
# Copy binary from builder
COPY --from=builder --chown=sequencer_user:sequencer_user /usr/local/bin/sequencer_service /usr/local/bin/sequencer_service
COPY --from=builder --chown=sequencer_service_user:sequencer_service_user /usr/local/bin/sequencer_service /usr/local/bin/sequencer_service
# Copy r0vm binary from builder
COPY --from=builder --chown=sequencer_user:sequencer_user /usr/local/bin/r0vm /usr/local/bin/r0vm
COPY --from=builder --chown=sequencer_service_user:sequencer_service_user /usr/local/bin/r0vm /usr/local/bin/r0vm
VOLUME /var/lib/sequencer_service
@ -103,7 +109,7 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
-H "Content-Type: application/json" \
-d "{ \
\"jsonrpc\": \"2.0\", \
\"method\": \"hello\", \
\"method\": \"checkHealth\", \
\"params\": {}, \
\"id\": 1 \
}" || exit 1
@ -114,7 +120,7 @@ ENV RUST_LOG=info
# Set explicit location for r0vm binary
ENV RISC0_SERVER_PATH=/usr/local/bin/r0vm
USER sequencer_user
USER sequencer_service_user
WORKDIR /sequencer_service
CMD ["sequencer_service", "/etc/sequencer_service/sequencer_config.json"]

View File

@ -13,7 +13,6 @@
"channel_id": "0101010101010101010101010101010101010101010101010101010101010101",
"node_url": "http://localhost:8080"
},
"indexer_rpc_url": "ws://localhost:8779",
"genesis": [
{
"supply_bridge_account": {

View File

@ -11,9 +11,8 @@
"max_retries": 5
},
"channel_id": "0101010101010101010101010101010101010101010101010101010101010101",
"node_url": "http://localhost:18080"
"node_url": "http://host.docker.internal:8080"
},
"indexer_rpc_url": "ws://localhost:8779",
"genesis": [
{
"supply_bridge_account": {

View File

@ -2,7 +2,7 @@ services:
sequencer_service:
image: lez/sequencer_service
build:
context: ../..
context: ../../..
dockerfile: lez/sequencer/service/Dockerfile
container_name: sequencer_service
ports: