Aqso commited on
Commit
21592f5
·
verified ·
1 Parent(s): 7a02909

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -8
Dockerfile CHANGED
@@ -3,13 +3,13 @@ FROM ubuntu:22.04
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV HOSTNAME=AQSO-Bot
5
 
6
- # 1. Install Tool & DNS-over-HTTPS (DoH)
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
  ca-certificates curl wget git sudo procps xz-utils \
9
  dnscrypt-proxy supervisor \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # 2. Install Node.js v22 (Binary)
13
  RUN wget https://nodejs.org/dist/v22.13.1/node-v22.13.1-linux-x64.tar.xz && \
14
  tar -xJf node-v22.13.1-linux-x64.tar.xz -C /usr/local --strip-components=1 && \
15
  rm node-v22.13.1-linux-x64.tar.xz
@@ -17,13 +17,23 @@ RUN wget https://nodejs.org/dist/v22.13.1/node-v22.13.1-linux-x64.tar.xz && \
17
  # 3. Install code-server
18
  RUN curl -fsSL https://code-server.dev/install.sh | sh
19
 
20
- # 4. Config DNSCrypt (Bypass DNS HF)
 
 
 
 
 
 
 
 
 
 
 
 
21
  RUN echo "server_names = ['cloudflare', 'google']\nlisten_addresses = ['127.0.0.1:53']\nforce_tcp = true" > /etc/dnscrypt-proxy/dnscrypt-proxy.toml
22
-
23
- # 5. Config Supervisor (Pengganti systemctl)
24
  RUN echo "[supervisord]\nnodaemon=true\nuser=root\n\n[program:dnscrypt]\ncommand=dnscrypt-proxy -config /etc/dnscrypt-proxy/dnscrypt-proxy.toml\nautostart=true\n\n[program:codeserver]\ncommand=code-server --bind-addr 0.0.0.0:7860 --auth none --user-data-dir /tmp/vsc --extensions-dir /tmp/ext\nuser=user\nenvironment=HOME=\"/home/user\"\nautostart=true" > /etc/supervisor/conf.d/services.conf
25
 
26
- # 6. Setup User
27
  RUN useradd -m -u 1000 user
28
  WORKDIR /home/user/app
29
  RUN mkdir -p /tmp/vsc /tmp/ext && chown -R user:user /tmp/vsc /tmp/ext /home/user/app
@@ -31,5 +41,5 @@ RUN mkdir -p /tmp/vsc /tmp/ext && chown -R user:user /tmp/vsc /tmp/ext /home/use
31
  USER root
32
  EXPOSE 7860
33
 
34
- # 7. FORCE DNS OVERWRITE & START
35
- CMD ["sh", "-c", "echo 'nameserver 127.0.0.1' > /etc/resolv.conf && /usr/bin/supervisord -c /etc/supervisor/supervisord.conf"]
 
3
  ENV DEBIAN_FRONTEND=noninteractive
4
  ENV HOSTNAME=AQSO-Bot
5
 
6
+ # 1. Install Dasar & DNS Tool
7
  RUN apt-get update && apt-get install -y --no-install-recommends \
8
  ca-certificates curl wget git sudo procps xz-utils \
9
  dnscrypt-proxy supervisor \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
+ # 2. Install Node.js v22 (Binary) - Penting buat Bot WA lu
13
  RUN wget https://nodejs.org/dist/v22.13.1/node-v22.13.1-linux-x64.tar.xz && \
14
  tar -xJf node-v22.13.1-linux-x64.tar.xz -C /usr/local --strip-components=1 && \
15
  rm node-v22.13.1-linux-x64.tar.xz
 
17
  # 3. Install code-server
18
  RUN curl -fsSL https://code-server.dev/install.sh | sh
19
 
20
+ # 4. Buat Script Entrypoint (Solusi Anti-Resolve)
21
+ RUN echo '#!/bin/bash\n\
22
+ # Trik 1: Hardcode GitHub IP (Bypass DNS total buat git clone)\n\
23
+ echo "140.82.112.4 github.com" >> /etc/hosts\n\
24
+ echo "140.82.112.3 www.github.com" >> /etc/hosts\n\
25
+ \n\
26
+ # Trik 2: Paksa Resolv Conf (Looping agar tidak di-overwrite HF)\n\
27
+ (while true; do echo "nameserver 1.1.1.1" > /etc/resolv.conf; sleep 10; done) &\n\
28
+ \n\
29
+ # Trik 3: Jalankan Process Manager\n\
30
+ /usr/bin/supervisord -c /etc/supervisor/supervisord.conf' > /usr/local/bin/entrypoint.sh && chmod +x /usr/local/bin/entrypoint.sh
31
+
32
+ # 5. Config DNSCrypt & Supervisor
33
  RUN echo "server_names = ['cloudflare', 'google']\nlisten_addresses = ['127.0.0.1:53']\nforce_tcp = true" > /etc/dnscrypt-proxy/dnscrypt-proxy.toml
 
 
34
  RUN echo "[supervisord]\nnodaemon=true\nuser=root\n\n[program:dnscrypt]\ncommand=dnscrypt-proxy -config /etc/dnscrypt-proxy/dnscrypt-proxy.toml\nautostart=true\n\n[program:codeserver]\ncommand=code-server --bind-addr 0.0.0.0:7860 --auth none --user-data-dir /tmp/vsc --extensions-dir /tmp/ext\nuser=user\nenvironment=HOME=\"/home/user\"\nautostart=true" > /etc/supervisor/conf.d/services.conf
35
 
36
+ # 6. Setup User & Permission
37
  RUN useradd -m -u 1000 user
38
  WORKDIR /home/user/app
39
  RUN mkdir -p /tmp/vsc /tmp/ext && chown -R user:user /tmp/vsc /tmp/ext /home/user/app
 
41
  USER root
42
  EXPOSE 7860
43
 
44
+ # JALANKAN VIA ENTRYPOINT SCRIPT
45
+ CMD ["/usr/local/bin/entrypoint.sh"]