-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathdockerfile
78 lines (61 loc) · 2.25 KB
/
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
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# Jackson Coxson
# todo finish this
# Use a base image with Rust for building the project
FROM rust:latest AS builder
# Install Python and pip (required for tunneld dependencies)
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
wireguard-tools && \
rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy the project files into the container
COPY . .
# Build the JitStreamer EB project in release mode
RUN cargo build --release
# Clone and build netmuxd
RUN git clone https://github.com/jkcoxson/netmuxd.git && \
cd netmuxd && \
git reset --hard bb1477bf8c610343d203098f85869e88ee9bb149 && \
cargo build --release && \
cd ..
RUN git clone https://github.com/jkcoxson/tunneld-rs.git && \
cd tunneld-rs && \
git reset --hard 7371cffbf93f4984e9c54186a29e1c6dd6775eb1 && \
cargo build --release && \
cd ..
# Prepare the final runtime image
FROM debian:bookworm-slim
# Install required runtime dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
wireguard-tools \
iproute2 \
librust-openssl-dev \
libssl-dev && \
rm -rf /var/lib/apt/lists/*
# Copy the built binary and necessary files from the builder stage
COPY --from=builder /app/target/release/jitstreamer-eb /usr/local/bin/jitstreamer-eb
COPY --from=builder /app/netmuxd/target/release/netmuxd /usr/local/bin/netmuxd
COPY --from=builder /app/tunneld-rs/target/release/tunneld-rs /usr/local/bin/tunneld-rs
COPY --from=builder /app/requirements.txt /app/requirements.txt
COPY --from=builder /app/src/runners /app/src/runners
# Ensure src/runners/*.python files are included
COPY src/runners /app/src/runners
# Install Python dependencies for tunneld
# Break the system packages, I drink error message tears for breakfast
RUN pip3 install -r /app/requirements.txt --break-system-packages
# Set the default working directory
WORKDIR /app
RUN mkdir -p /var/lib/lockdown
RUN mkdir -p /etc/wireguard
# Expose Wireguard and Jitstreamer ports
EXPOSE 51869/udp
EXPOSE 9172/tcp
VOLUME /var/lib/lockdown
VOLUME /etc/wireguard
VOLUME /app/jitstreamer.db
# Command to start all required services and run the program
CMD ["/bin/bash", "-c", "wg-quick up jitstreamer & netmuxd & tunneld-rs & jitstreamer-eb"]