Skip to content

Commit c7706a2

Browse files
author
mike dupont
committed
adding rust
1 parent 9b0ff60 commit c7706a2

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

Dockerfile

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
#FROM node:23-slim AS base
22
FROM arm64v8/node:23-bookworm-slim AS base
3+
# Update default packages
4+
RUN apt-get update
5+
6+
# Get Ubuntu packages
7+
RUN apt-get install -y \
8+
build-essential \
9+
curl
10+
11+
# Update new packages
12+
RUN apt-get update
13+
14+
# Get Rust
15+
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
16+
17+
RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
18+
319
RUN corepack enable
420
COPY . /node_modules/fastembed
521
WORKDIR /node_modules/fastembed
@@ -9,7 +25,8 @@ RUN yarn install
925

1026
FROM base AS build
1127
RUN yarn install --frozen-lockfile
12-
RUN yarn run tsc
28+
RUN yarn run build
29+
RUN yarn run prepublishOnly
1330

1431
FROM base
1532
COPY --from=prod-deps /node_modules/ /app/node_modules/

Dockerfile.amd

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
FROM node:23-bookworm-slim AS base
2+
3+
# Update default packages
4+
RUN apt-get update
5+
6+
# Get Ubuntu packages
7+
RUN apt-get install -y \
8+
build-essential \
9+
curl
10+
11+
# Update new packages
12+
RUN apt-get update
13+
14+
# Get Rust
15+
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
16+
17+
RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
18+
19+
RUN corepack enable
20+
COPY . /node_modules/fastembed
21+
WORKDIR /node_modules/fastembed
22+
23+
FROM base AS prod-deps
24+
RUN yarn install
25+
26+
FROM base AS build
27+
RUN yarn install --frozen-lockfile
28+
29+
RUN yarn run build
30+
RUN yarn run prepublishOnly
31+
FROM base
32+
COPY --from=prod-deps /node_modules/ /app/node_modules/
33+
COPY --from=build /node_modules/ /app/node_modules/

0 commit comments

Comments
 (0)