-
Notifications
You must be signed in to change notification settings - Fork 44
/
ttyd-Dockerfile
38 lines (30 loc) · 1.13 KB
/
ttyd-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
# Use Debian as base image
FROM debian:latest
# Install necessary build tools
RUN apt-get update && \
apt-get install -y sudo build-essential cmake git libjson-c-dev libwebsockets-dev zlib1g-dev curl
# Install Rust and Cargo
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y && \
export PATH="$HOME/.cargo/bin:$PATH" && \
rustup default stable
# Clone and build ttyd
RUN git clone https://github.com/tsl0922/ttyd.git && \
cd ttyd && \
mkdir build && \
cd build && \
cmake .. && \
make && \
make install
# Clone AdGuardian-Term and build
RUN git clone https://github.com/Lissy93/AdGuardian-Term.git && \
cd AdGuardian-Term && \
$HOME/.cargo/bin/cargo build --release && \
mv ./target/release/adguardian /usr/local/bin/adguardian
# Expose port 7681
EXPOSE 7681
ENV ADGUARD_IP={define your adguard ip here}
ENV ADGUARD_PORT={define the adguard port here, most likely 80}
ENV ADGUARD_USERNAME={add you username of adguard here}
ENV ADGUARD_PASSWORD={add your adguard password here}
# Set the start command
CMD ["ttyd", "-W","-c", "${ADGUARD_USERNAME}:${ADGUARD_PASSWORD}", "/usr/local/bin/adguardian"]