-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
35 lines (22 loc) · 867 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
FROM rust:1.71.1-bookworm as base
WORKDIR /opt/cowsay
RUN apt-get update && apt-get install -y protobuf-compiler
COPY . .
FROM base AS cowbot-builder
WORKDIR /opt/cowsay/cowbot
RUN cargo build --release
FROM base AS cowbot-standalone-builder
WORKDIR /opt/cowsay/cowbot
RUN cargo build --release --no-default-features
FROM base AS cowserve-builder
WORKDIR /opt/cowsay/cowserve
RUN unset DATABASE_URL && cargo build --release
FROM base AS cowserve-production
COPY --from=cowserve-builder /opt/cowsay/cowserve/target/release/cowserve /usr/local/bin/cowserve
CMD cowserve
FROM base AS cowbot-production
COPY --from=cowbot-builder /opt/cowsay/cowbot/target/release/cowbot /usr/local/bin/cowbot
CMD cowbot
FROM base AS cowbot-standalone-production
COPY --from=cowbot-standalone-builder /opt/cowsay/cowbot/target/release/cowbot /usr/local/bin/cowbot
CMD cowbot