-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (51 loc) · 1.07 KB
/
Dockerfile
File metadata and controls
62 lines (51 loc) · 1.07 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
58
59
60
61
62
# Stage 1 build
FROM rust:1.95.0 AS builder
WORKDIR /app
COPY . ./
ARG NOTEBOOK=false
ARG LIFECYCLE=false
ARG OBSERVE=false
ARG MCP=false
ARG OWUI=false
RUN <<EOF
#!/bin/bash
flags=()
if [ "$NOTEBOOK" = "true" ]; then
flags+=("notebook")
fi
if [ "$LIFECYCLE" = "true" ]; then
flags+=("lifecycle")
fi
if [ "$OBSERVE" = "true" ]; then
flags+=("observe")
fi
if [ "$MCP" = "true" ]; then
flags+=("mcp")
fi
if [ "$OWUI" = "true" ]; then
flags+=("openwebui")
fi
if [ ${#flags[@]} -eq 0 ]; then
echo "Building with no features..."
cargo build --release
else
features_string=$(IFS=,; echo "${flags[*]}")
echo "Building with features: $features_string"
cargo build --release --features "$features_string"
fi
EOF
# Stage 2 build
FROM debian:stable-slim
WORKDIR /app
RUN apt update -y && apt install openssl -y && apt install ca-certificates
COPY --from=builder /app/target/release/bridge .
COPY ./certs ./certs
COPY ./config ./config
COPY ./templates ./templates
COPY ./static ./static
RUN chgrp -R 0 /app && \
chmod -R g=u /app
USER 1001
EXPOSE 8080
EXPOSE 8000
CMD ["./bridge"]