-
Notifications
You must be signed in to change notification settings - Fork 42
/
Dockerfile
40 lines (26 loc) · 896 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Use the official Node.js image to build web clients and components
FROM node:latest AS web
# Set the working directory to /build and copy files into it
WORKDIR /build
COPY . /build
# Build the web bundles
RUN npm ci
RUN cd web && npm run build
# Use the official Rust image to build CLI
FROM rust:latest AS cli
# Set the working directory to /build and copy files into it
WORKDIR /build
COPY . /build
# Copy the web build into the expected location
COPY --from=web /build/web/dist /build/web/dist
# Build the binary
RUN cargo build --bin stencila --release
# Use small distroless image
FROM gcr.io/distroless/cc-debian12
# Copy the binary into the image from the CLI build stage
COPY --from=cli /build/target/release/stencila /
# Expose the default Stencila port
EXPOSE 9000
# Set the entry point to run the Stencila binary and the default command
ENTRYPOINT ["/stencila"]
CMD []