Skip to content

Commit

Permalink
adding rust
Browse files Browse the repository at this point in the history
  • Loading branch information
mike dupont committed Jan 14, 2025
1 parent 9b0ff60 commit c7706a2
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
19 changes: 18 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
#FROM node:23-slim AS base
FROM arm64v8/node:23-bookworm-slim AS base
# Update default packages
RUN apt-get update

# Get Ubuntu packages
RUN apt-get install -y \
build-essential \
curl

# Update new packages
RUN apt-get update

# Get Rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y

RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc

RUN corepack enable
COPY . /node_modules/fastembed
WORKDIR /node_modules/fastembed
Expand All @@ -9,7 +25,8 @@ RUN yarn install

FROM base AS build
RUN yarn install --frozen-lockfile
RUN yarn run tsc
RUN yarn run build
RUN yarn run prepublishOnly

FROM base
COPY --from=prod-deps /node_modules/ /app/node_modules/
Expand Down
33 changes: 33 additions & 0 deletions Dockerfile.amd
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM node:23-bookworm-slim AS base

# Update default packages
RUN apt-get update

# Get Ubuntu packages
RUN apt-get install -y \
build-essential \
curl

# Update new packages
RUN apt-get update

# Get Rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y

RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc

RUN corepack enable
COPY . /node_modules/fastembed
WORKDIR /node_modules/fastembed

FROM base AS prod-deps
RUN yarn install

FROM base AS build
RUN yarn install --frozen-lockfile

RUN yarn run build
RUN yarn run prepublishOnly
FROM base
COPY --from=prod-deps /node_modules/ /app/node_modules/
COPY --from=build /node_modules/ /app/node_modules/

0 comments on commit c7706a2

Please sign in to comment.