FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive # Install required packages RUN apt update && apt install -y \ tzdata \ iproute2 \ net-tools \ curl \ iptables \ ca-certificates \ sudo \ python3 \ python3-pip \ && ln -fs /usr/share/zoneinfo/Etc/UTC /etc/localtime \ && echo "Etc/UTC" > /etc/timezone \ && dpkg-reconfigure -f noninteractive tzdata \ && rm -rf /var/lib/apt/lists/* # Create user RUN useradd -m -s /bin/bash user && \ echo 'user:yourpassword' | chpasswd && \ echo 'user ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers RUN mkdir -p /var/run/tailscale # Install Tailscale RUN curl -fsSL https://tailscale.com/install.sh | sh # Install Python dependencies RUN pip3 install flask gunicorn # Set working directory WORKDIR /app # Copy app files COPY app.py /app COPY run.sh /app RUN chmod +x /app/run.sh # Expose Flask port EXPOSE 7860 # Default command CMD ["/app/run.sh"]