Skip to content

Combined docker image #231

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
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
33 changes: 33 additions & 0 deletions DockerfileCombined
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Use a multi-stage build to build both frontend and backend

# Stage 1: Build frontend
FROM node:lts AS frontend-builder
RUN apt-get update && apt-get install -y openssh-client
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
WORKDIR /app
#ARG GITHUB_TOKEN
RUN #git clone https://${GITHUB_TOKEN}@github.com/Embucket/embucket.git .
RUN --mount=type=ssh git clone [email protected]:Embucket/embucket.git .
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of mounting from SSH, maybe as part of the github flow it can be checked out locally, since the bot will have a GITHUB_TOKEN available

RUN npm install -g pnpm
RUN pnpm install

# Stage 2: Build backend
FROM rust:latest AS builder
RUN update-ca-certificates
WORKDIR /app
COPY ./ .
COPY rest-catalog-open-api.yaml rest-catalog-open-api.yaml
RUN cargo build --release

# Stage 3: Final image
FROM debian:bookworm-slim
WORKDIR /app
RUN apt-get update && apt-get install -y openssl nodejs npm && rm -rf /var/lib/apt/lists/*
RUN npm install -g pnpm serve

COPY --from=builder /app/target/release/bucketd ./
COPY --from=builder /app/rest-catalog-open-api.yaml rest-catalog-open-api.yaml
COPY --from=frontend-builder /app ./frontend

# Command to start both frontend and backend
CMD ["sh", "-c", "./bucketd & cd ./frontend && pnpm i && pnpm codegen && pnpm dev"]
2 changes: 1 addition & 1 deletion crates/nexus/src/http/ui/handlers/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub struct ApiDoc;
post,
path = "/ui/query",
request_body = QueryPayload,
operation_id = "query",
operation_id = "runQuery",
tags = ["query"],
responses(
(status = 200, description = "Returns result of the query", body = QueryResponse),
Expand Down
Loading