Files
ofvp_Server/Dockerfile
T
2021-12-25 11:41:38 -03:00

70 lines
2.8 KiB
Docker

# Servers
FROM ubuntu:latest AS servers
ENV DEBIAN_FRONTEND="noninteractive"
LABEL name="OFVp Server"
LABEL org.opencontainers.image.title="OFVp Server"
LABEL org.opencontainers.image.description="Start a server for Http Injector in the fastest and easiest way to maintain and update as new tools are released and your host does not need to restart with all new changes."
LABEL org.opencontainers.image.vendor="Sirherobrine23"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.source="https://github.com/OFVp-Project/Server.git"
# Ports
EXPOSE 22/tcp 80/tcp 7300/tcp 51820/udp 3000/tcp
# Install Core Packages
RUN apt update && apt -y install build-essential wget curl git unzip zip zsh sudo jq screen nano ca-certificates net-tools bc lsof dos2unix nload zlib1g-dev ifupdown iputils-ping iproute2 tzdata openssl ntp procps openresolv inotify-tools gnupg libc6 libelf-dev perl pkg-config figlet python3 python python3-pip
# Install BadVPN
RUN RELEASE_TAG="$(curl -Ssl https://api.github.com/repos/OFVp-Project/BadvpnBin/releases/latest | grep 'tag_name' | cut -d '"' -f 4)"; \
wget "https://github.com/OFVp-Project/BadvpnBin/releases/download/${RELEASE_TAG}/badvpn-udpgw-$(uname -m)" -O /usr/bin/badvpn-udpgw && \
chmod +x -v /usr/bin/badvpn-udpgw
# Change bash to zsh
RUN usermod --shell /usr/bin/zsh root
# Install Openssh Server
RUN apt update && apt install -y openssh-server && \
rm -fv /etc/ssh/sshd_config /etc/ssh/ssh_host_*
# Install Wireguard
RUN apt-get -y install debconf-utils && \
echo resolvconf resolvconf/linkify-resolvconf boolean false | debconf-set-selections && \
apt-get -y install resolvconf && \
apt -y install wireguard-tools iptables iproute2 resolvconf qrencode dkms wireguard
# Install v2ray
RUN \
V2RAY_VERSION="$(curl -Ssl https://api.github.com/repos/v2fly/v2ray-core/releases/latest | grep 'tag_name' | cut -d '"' -f 4)"; \
case "$(uname -m)" in \
x86_64) V2RAY_PLATFORM="64";; \
aarch64) V2RAY_PLATFORM="arm64-v8a";; \
armv7l) V2RAY_PLATFORM="arm32-v7a";; \
*) echo "Unknown architecture: $(uname -m)"; exit 1;; \
esac && \
wget "https://github.com/v2fly/v2ray-core/releases/download/${V2RAY_VERSION}/v2ray-linux-${V2RAY_PLATFORM}.zip" -O /tmp/v2ray.zip && \
mkdir -p /opt/v2ray && \
unzip /tmp/v2ray.zip -d /opt/v2ray && \
rm -fv /tmp/v2ray.zip
# Install latest NodeJS
RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - && apt install -y nodejs && npm install -g npm@latest
# Copy and Install Dependecies
WORKDIR /usr/src/Backend
# Copy Backend Control
COPY package*.json ./
RUN npm install --no-save
COPY ./ ./
ENV \
Service_Squid="false" \
Service_Badvpn="true" \
Service_ssh="true" \
Service_WebProxy="true" \
Service_Wireguard="true" \
MongoDB_URL="mongodb://ofvp_mongodb:27017"
# Set Entrypoint
ENTRYPOINT [ "node", "--no-warnings", "src/index.js" ]