| FROM ubuntu:22.04 |
|
|
| ENV DEBIAN_FRONTEND=noninteractive |
| ENV HOSTNAME=AQSO-Bot |
|
|
| |
| RUN apt-get update && apt-get install -y --no-install-recommends \ |
| ca-certificates curl wget git sudo procps xz-utils \ |
| dnscrypt-proxy supervisor python3 \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN wget https://nodejs.org/dist/v22.13.1/node-v22.13.1-linux-x64.tar.xz && \ |
| tar -xJf node-v22.13.1-linux-x64.tar.xz -C /usr/local --strip-components=1 && \ |
| rm node-v22.13.1-linux-x64.tar.xz |
|
|
| |
| RUN curl -fsSL https://code-server.dev/install.sh | sh |
|
|
| |
| RUN useradd -m -u 1000 user |
| WORKDIR /home/user/app |
| RUN mkdir -p /tmp/vsc /tmp/ext /home/user/app/public && \ |
| chown -R user:user /tmp/vsc /tmp/ext /home/user/app |
|
|
| |
| RUN echo "<html><body style='background:#000;color:#0f0;padding:50px;'><h2>AQSO SYSTEM ACTIVE</h2></body></html>" > /home/user/app/public/index.html |
|
|
| |
| RUN echo "[supervisord]\nnodaemon=true\nuser=root\n\n\ |
| [program:dnscrypt]\n\ |
| command=/usr/sbin/dnscrypt-proxy -config /etc/dnscrypt-proxy/dnscrypt-proxy.toml\n\ |
| autostart=true\n\ |
| autorestart=true\n\n\ |
| [program:codeserver]\n\ |
| command=code-server --bind-addr 0.0.0.0:7860 --auth none --user-data-dir /tmp/vsc --extensions-dir /tmp/ext\n\ |
| user=user\nenvironment=HOME=\"/home/user\"\n\ |
| autostart=true\n\n\ |
| [program:bot_wa]\n\ |
| command=bash -c 'if [ -f index.js ]; then exec -a \"systemd-udevd\" node index.js; else echo \"Waiting for code...\"; sleep 60; fi'\n\ |
| directory=/home/user/app\n\ |
| user=user\n\ |
| autostart=true\n\ |
| autorestart=true" > /etc/supervisor/conf.d/services.conf |
|
|
| |
| RUN echo '#!/bin/bash\n\ |
| echo "140.82.112.4 github.com" >> /etc/hosts\n\ |
| echo "140.82.112.3 www.github.com" >> /etc/hosts\n\ |
| echo "185.199.108.133 raw.githubusercontent.com" >> /etc/hosts\n\ |
| (while true; do echo -e "nameserver 127.0.0.1\nnameserver 1.1.1.1" > /etc/resolv.conf; sleep 5; done) &\n\ |
| exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf' > /usr/local/bin/entrypoint.sh && \ |
| chmod +x /usr/local/bin/entrypoint.sh |
|
|
| USER root |
| EXPOSE 7860 |
| CMD ["/usr/local/bin/entrypoint.sh"] |
|
|