2021-07-12 20:14:39 +00:00
|
|
|
# syntax = docker/dockerfile:1.2
|
|
|
|
|
2022-01-26 20:54:51 +00:00
|
|
|
FROM rust:1.58-bullseye as builder
|
2021-07-12 20:14:39 +00:00
|
|
|
WORKDIR app
|
|
|
|
COPY . .
|
|
|
|
|
2022-04-09 14:30:42 +00:00
|
|
|
# Compile collab server
|
2021-07-12 20:14:39 +00:00
|
|
|
RUN --mount=type=cache,target=./script/node_modules \
|
|
|
|
--mount=type=cache,target=/usr/local/cargo/registry \
|
|
|
|
--mount=type=cache,target=./target \
|
2022-04-09 14:30:42 +00:00
|
|
|
cargo build --release --package collab --bin collab
|
2021-07-12 20:14:39 +00:00
|
|
|
|
2022-04-09 14:30:42 +00:00
|
|
|
# Copy collab server binary out of cached directory
|
2021-07-12 20:14:39 +00:00
|
|
|
RUN --mount=type=cache,target=./target \
|
2022-04-09 14:30:42 +00:00
|
|
|
cp /app/target/release/collab /app/collab
|
2021-07-12 20:14:39 +00:00
|
|
|
|
2022-04-09 14:30:42 +00:00
|
|
|
# Copy collab server binary to the runtime image
|
2021-09-13 20:03:00 +00:00
|
|
|
FROM debian:bullseye-slim as runtime
|
2021-07-12 20:14:39 +00:00
|
|
|
RUN apt-get update; \
|
|
|
|
apt-get install -y --no-install-recommends libcurl4-openssl-dev ca-certificates
|
|
|
|
WORKDIR app
|
2022-04-09 14:30:42 +00:00
|
|
|
COPY --from=builder /app/collab /app
|
|
|
|
ENTRYPOINT ["/app/collab"]
|