forked from tailcallhq/tailcall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
29 lines (20 loc) · 889 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
# Builder stage
FROM rust:slim-buster AS builder
WORKDIR /prod
# Copy manifests and the graphql file
COPY Cargo.lock Cargo.toml examples/jsonplaceholder.graphql ./
# This is the trick to speed up the building process.
RUN mkdir .cargo \
&& cargo vendor > .cargo/config
# Install required system dependencies and cleanup in the same layer
RUN apt-get update && apt-get install -y pkg-config libssl-dev python g++ git make && apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy the rest of the source code
COPY . .
# Compile the project
RUN RUST_BACKTRACE=1 cargo build --release
# Runner stage
FROM fedora:34 AS runner
# Copy necessary files from the builder stage
COPY --from=builder /prod/target/release/tailcall /bin
COPY --from=builder /prod/jsonplaceholder.graphql /jsonplaceholder.graphql
CMD ["/bin/tailcall", "start", "jsonplaceholder.graphql", "--log-level", "error"]