Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ jobs:
&& 'type=cacheonly'
|| format('type=image,name={0}/{1},push-by-digest=true,name-canonical=true,push=true', env.REGISTRY, env.IMAGE_NAME)
}}
build-args: |
GIT_COMMIT=${{ github.sha }}
BUILD_TIME=${{ github.event.repository.updated_at }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ jobs:
file: ./Dockerfile
push: false
tags: ${{ env.IMAGE_NAME }}:test
build-args: |
GIT_COMMIT=${{ github.sha }}
BUILD_TIME=${{ github.event.repository.updated_at }}
cache-from: type=gha
cache-to: type=gha,mode=max

Expand Down
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ RUN apt-get update && apt-get install -y --no-install-recommends pkg-config \
COPY Cargo.toml Cargo.lock ./
COPY crates ./crates
COPY migrations ./migrations
# Build-time metadata baked into the binary via option_env!() macros.
# Pass these with --build-arg GIT_COMMIT=$(git rev-parse --short HEAD)
# and --build-arg BUILD_TIME=$(date -u +%Y-%m-%dT%H:%M:%SZ) at image
# build time so the /health endpoint reports real values instead of "unknown".
ARG GIT_COMMIT=""
ARG BUILD_TIME=""
ENV LUMENQRAPH_GIT_SHA=${GIT_COMMIT}
ENV LUMENQRAPH_BUILD_TIME=${BUILD_TIME}
RUN cargo build --release --workspace

FROM debian:bookworm-slim@sha256:88200866dfff7ea7f5cbcb6ec7c8a701889efe6fe859fe64d6990e4b07ea4171 AS runtime
Expand Down
22 changes: 19 additions & 3 deletions docker-compose.full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
# IMPORTANT: Set WEBHOOK_ENCRYPTION_KEY in your environment before starting:
# export WEBHOOK_ENCRYPTION_KEY=$(openssl rand -hex 32)
# docker compose -f docker-compose.full.yml up --build
#
# Optional: set GIT_COMMIT and BUILD_TIME for accurate /health build info:
# export GIT_COMMIT=$(git rev-parse --short HEAD)
# export BUILD_TIME=$(date -u +%Y-%m-%dT%H:%M:%SZ)

services:
postgres:
Expand All @@ -24,7 +28,11 @@ services:
start_period: 10s

indexer:
build: .
build:
context: .
args:
GIT_COMMIT: ${GIT_COMMIT:-}
BUILD_TIME: ${BUILD_TIME:-}
command: ["lumenqraph-indexer"]
restart: unless-stopped
depends_on:
Expand All @@ -38,7 +46,11 @@ services:
RUST_LOG: ${RUST_LOG:-info}

api:
build: .
build:
context: .
args:
GIT_COMMIT: ${GIT_COMMIT:-}
BUILD_TIME: ${BUILD_TIME:-}
command: ["lumenqraph-api"]
restart: unless-stopped
depends_on:
Expand All @@ -61,7 +73,11 @@ services:
start_period: 10s

webhooks:
build: .
build:
context: .
args:
GIT_COMMIT: ${GIT_COMMIT:-}
BUILD_TIME: ${BUILD_TIME:-}
command: ["lumenqraph-webhooks"]
restart: unless-stopped
depends_on:
Expand Down
Loading