-
Notifications
You must be signed in to change notification settings - Fork 106
Expand file tree
/
Copy pathDockerfile
More file actions
57 lines (42 loc) · 1.21 KB
/
Dockerfile
File metadata and controls
57 lines (42 loc) · 1.21 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# This Dockerfile is composed of several steps, to make cargo chef work.
# The final step copies the triagebot binary inside another, empty image.
#################
# Build image #
#################
FROM rust:1.93 AS base
RUN cargo install --locked cargo-chef
RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
g++ \
curl \
ca-certificates \
libc6-dev \
make \
libssl-dev \
pkg-config \
git \
cmake \
zlib1g-dev
FROM base AS planner
COPY . .
RUN cargo chef prepare --recipe-path recipe.json
FROM base AS builder
# Copy build recipe
COPY --from=planner /recipe.json recipe.json
# Build dependencies - this is the caching Docker layer!
RUN cargo chef cook --release --recipe-path recipe.json
# And now build the rest
COPY . .
RUN cargo build --release
##################
# Output image #
##################
FROM ubuntu:24.04 AS binary
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y \
ca-certificates
RUN mkdir -p /opt/triagebot
COPY --from=builder /target/release/triagebot /usr/local/bin/
COPY templates /opt/triagebot/templates
WORKDIR /opt/triagebot
ENV PORT=80
CMD triagebot