mirror of
https://github.com/moghtech/komodo.git
synced 2026-08-25 08:00:17 +00:00
core image include util binary
This commit is contained in:
@@ -11,7 +11,8 @@ COPY ./client/periphery ./client/periphery
|
||||
COPY ./bin/core ./bin/core
|
||||
|
||||
# Compile app
|
||||
RUN cargo build -p komodo_core --release
|
||||
RUN cargo build -p komodo_core --release && \
|
||||
cargo build -p komodo_util --release
|
||||
|
||||
# Build Frontend
|
||||
FROM node:20.12-alpine AS frontend-builder
|
||||
@@ -35,6 +36,7 @@ WORKDIR /app
|
||||
COPY ./config/core.config.toml /config/config.toml
|
||||
COPY --from=frontend-builder /builder/frontend/dist /app/frontend
|
||||
COPY --from=core-builder /builder/target/release/core /usr/local/bin/core
|
||||
COPY --from=core-builder /builder/target/release/util /usr/local/bin/util
|
||||
COPY --from=denoland/deno:bin /deno /usr/local/bin/deno
|
||||
|
||||
# Set $DENO_DIR and preload external Deno deps
|
||||
|
||||
@@ -22,10 +22,16 @@ RUN sh ./debian-deps.sh && rm ./debian-deps.sh
|
||||
WORKDIR /app
|
||||
|
||||
# Copy both binaries initially, but only keep appropriate one for the TARGETPLATFORM.
|
||||
COPY --from=x86_64 /core /app/arch/linux/amd64
|
||||
COPY --from=aarch64 /core /app/arch/linux/arm64
|
||||
COPY --from=x86_64 /core /app/core/linux/amd64
|
||||
COPY --from=aarch64 /core /app/core/linux/arm64
|
||||
ARG TARGETPLATFORM
|
||||
RUN mv /app/arch/${TARGETPLATFORM} /usr/local/bin/core && rm -r /app/arch
|
||||
RUN mv /app/core/${TARGETPLATFORM} /usr/local/bin/core && rm -r /app/core
|
||||
|
||||
# Same for util
|
||||
COPY --from=x86_64 /util /app/util/linux/amd64
|
||||
COPY --from=aarch64 /util /app/util/linux/arm64
|
||||
ARG TARGETPLATFORM
|
||||
RUN mv /app/util/${TARGETPLATFORM} /usr/local/bin/util && rm -r /app/util
|
||||
|
||||
# Copy default config / static frontend / deno binary
|
||||
COPY ./config/core.config.toml /config/config.toml
|
||||
|
||||
@@ -24,6 +24,7 @@ RUN sh ./debian-deps.sh && rm ./debian-deps.sh
|
||||
COPY ./config/core.config.toml /config/config.toml
|
||||
COPY --from=frontend-builder /builder/frontend/dist /app/frontend
|
||||
COPY --from=binaries /core /usr/local/bin/core
|
||||
COPY --from=binaries /util /usr/local/bin/util
|
||||
COPY --from=denoland/deno:bin /deno /usr/local/bin/deno
|
||||
|
||||
# Set $DENO_DIR and preload external Deno deps
|
||||
|
||||
@@ -31,9 +31,9 @@ pub async fn main() -> anyhow::Result<()> {
|
||||
.map(|collection| {
|
||||
let source = source_db.collection::<RawDocumentBuf>(&collection);
|
||||
let file_path = if collection == "Stats" {
|
||||
env.komodo_backup_folder.join("Stats.jsonl.gz")
|
||||
env.komodo_backup_folder.join("Stats.gz")
|
||||
} else {
|
||||
now_backup_folder.join(format!("{collection}.jsonl.gz"))
|
||||
now_backup_folder.join(format!("{collection}.gz"))
|
||||
};
|
||||
tokio::spawn(async move {
|
||||
let res = async {
|
||||
|
||||
@@ -179,7 +179,7 @@ async fn get_restore_files(
|
||||
String::from("Stats"),
|
||||
env
|
||||
.komodo_backup_folder
|
||||
.join("Stats.jsonl.gz")
|
||||
.join("Stats.gz")
|
||||
.components()
|
||||
.collect(),
|
||||
)];
|
||||
@@ -198,7 +198,7 @@ async fn get_restore_files(
|
||||
let Some(file_name) = file_name.to_str() else {
|
||||
continue;
|
||||
};
|
||||
let Some(collection) = file_name.strip_suffix(".jsonl.gz")
|
||||
let Some(collection) = file_name.strip_suffix(".gz")
|
||||
else {
|
||||
continue;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user