-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (25 loc) · 1.24 KB
/
Dockerfile
File metadata and controls
35 lines (25 loc) · 1.24 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
FROM rust:1.85-alpine AS builder
RUN apk add --no-cache musl-dev openssl-dev openssl-libs-static pkgconfig
WORKDIR /build
# Copy dependencies as standalone crates
COPY crates/_lib/lib-tarminal-sync ./lib-tarminal-sync
COPY crates/_lib/lib-plugin-abi ./lib-plugin-abi
# Copy cocoon core source
COPY plugins/adi.cocoon/core/Cargo.toml ./Cargo.toml
COPY plugins/adi.cocoon/core/src ./src
# Fix path dependencies to use local paths
RUN sed -i 's|path = "../_lib/lib-tarminal-sync"|path = "./lib-tarminal-sync"|g' Cargo.toml && \
sed -i 's|path = "../_lib/lib-plugin-abi"|path = "./lib-plugin-abi"|g' Cargo.toml
# Fix workspace inheritance in dependencies
RUN cd lib-plugin-abi && \
sed -i 's|version.workspace = true|version = "0.1.0"|g' Cargo.toml && \
sed -i 's|edition.workspace = true|edition = "2021"|g' Cargo.toml && \
sed -i 's|authors.workspace = true|authors = ["ADI Team"]|g' Cargo.toml && \
sed -i 's|abi_stable.workspace = true|abi_stable = "0.11"|g' Cargo.toml
RUN cargo build --release --features standalone
FROM alpine:latest
RUN apk add --no-cache ca-certificates
COPY --from=builder /build/target/release/cocoon /usr/local/bin/cocoon
ENV SIGNALING_SERVER_URL=ws://signaling:8080/ws
ENV COCOON_ID=""
CMD ["/usr/local/bin/cocoon"]