-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathDockerfile
40 lines (26 loc) · 863 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
FROM rust:1.77 AS builder
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
RUN sed -i '/default-members/d' Cargo.toml
RUN sed -i '/members = \[/,/\]/c\members = ["raphtory", "raphtory-graphql"]' Cargo.toml
WORKDIR /app/raphtory
COPY raphtory/Cargo.toml ./
RUN mkdir src && echo "fn main() {}" > src/main.rs
WORKDIR /app/raphtory-graphql
COPY raphtory-graphql/Cargo.toml ./
RUN mkdir src && echo "fn main() {}" > src/main.rs
WORKDIR /app
RUN cargo build --release --workspace
COPY raphtory ./raphtory
COPY raphtory-graphql ./raphtory-graphql
WORKDIR /app/raphtory-graphql
RUN cargo build --release
FROM rust:1.77-slim AS runner
WORKDIR /app
RUN groupadd -g 999 appuser && \
useradd -r -u 999 -g appuser appuser
USER appuser
COPY --from=builder /app/target/release/raphtory-graphql /app
EXPOSE 1736
ENV GRAPH_DIRECTORY=graphs
CMD ["./raphtory-graphql"]