FROM debian:13-slim ENV DEBIAN_FRONTEND=noninteractive \ PYTHONUNBUFFERED=1 # Apache2 + NetworkManager embarqué + outils Wi-Fi + Python RUN apt-get update \ && apt full-upgrade -y && apt-get install -y --no-install-recommends \ ca-certificates apache2 nano python3 python3-cryptography python3-dbus python3-paramiko tzdata \ network-manager wpasupplicant hostapd dbus \ iw wireless-tools iproute2 rfkill wireless-regdb \ dnsmasq-base iptables nftables procps kmod tcpdump \ wireguard-tools openvpn ebtables curl conntrack rclone \ && a2enmod proxy proxy_http headers setenvif remoteip rewrite \ && a2disconf other-vhosts-access-log 2>/dev/null || true \ && ln -sf /dev/stdout /var/log/apache2/access.log \ && ln -sf /dev/stderr /var/log/apache2/error.log \ && rm -rf /var/lib/apt/lists/* # Vos fichiers WORKDIR /app COPY ap.py /app/ap.py # Nom de votre fichier HTML dans le dossier de build (par défaut index.html) ARG HTML_FILE=index.html COPY ${HTML_FILE} /app/index.html COPY ${HTML_FILE} /var/www/html/index.html COPY setup.html /app/setup.html COPY setup.html /var/www/html/setup.html COPY images/ /app/images/ COPY images/ /var/www/html/images/ COPY lang/ /app/lang/ COPY lang/ /var/www/html/lang/ COPY themes/ /app/themes/ COPY themes/ /var/www/html/themes/ COPY jeux/ /app/jeux/ COPY jeux/ /var/www/html/jeux/ COPY version.json /app/version.json COPY version.json /var/www/html/version.json ARG AP_GIT_COMMIT="" ARG BUILD_DATE="" ENV AP_GIT_COMMIT=${AP_GIT_COMMIT} RUN if [ -n "${AP_GIT_COMMIT}" ]; then \ sed -i "s/\"commit\": *\"[^\"]*\"/\"commit\": \"${AP_GIT_COMMIT}\"/" /app/version.json /var/www/html/version.json 2>/dev/null || true; \ fi && \ if [ -n "${BUILD_DATE}" ]; then \ sed -i "s/\"build_date\": *\"[^\"]*\"/\"build_date\": \"${BUILD_DATE}\"/" /app/version.json /var/www/html/version.json 2>/dev/null || true; \ fi # L'API n'est plus joignable que via Apache : le HTML appelle /api sur le même port (1001) RUN sed -i 's#const API_URL=[^;]*;#const API_URL="";#' /app/index.html /var/www/html/index.html /app/setup.html /var/www/html/setup.html 2>/dev/null || true COPY apache-ap.conf /etc/apache2/sites-available/000-default.conf COPY entrypoint.sh /entrypoint.sh RUN chmod +x /entrypoint.sh && rm -f /var/www/html/index.html.orig \ && sed -i 's/^Listen 80$/Listen ${AP_WEB_PORT}/; s/^\s*Listen 443$/ Listen 1443/' /etc/apache2/ports.conf ENV AP_DB_FILE=/data/ap-dashboard.sqlite3 \ AP_CONNECTION_FILE=/data/connection \ AP_UPTIME_FILE=/data/uptime \ AP_BACKUP_DIR=/data/backups \ AP_DNS="1.1.1.1,9.9.9.9" VOLUME ["/data"] ENV AP_WEB_PORT=1001 EXPOSE 1001 ENTRYPOINT ["/entrypoint.sh"]