diff --git a/Dockerfile b/Dockerfile index 956631e..6af4fe4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,8 +5,8 @@ ENV DEBIAN_FRONTEND=noninteractive \ # Apache2 + NetworkManager embarqué + outils Wi-Fi + Python RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - apache2 python3 \ + && apt full-upgrade -y && apt-get install -y --no-install-recommends \ + apache2 nano python3 \ network-manager wpasupplicant dbus \ iw iproute2 rfkill wireless-regdb \ dnsmasq-base iptables nftables procps \ @@ -20,6 +20,7 @@ COPY ap.py /app/ap.py ARG HTML_FILE=index.html COPY ${HTML_FILE} /app/index.html COPY ${HTML_FILE} /var/www/html/index.html +COPY favicon.png /var/www/html/favicon.png # 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 COPY apache-ap.conf /etc/apache2/sites-available/000-default.conf diff --git a/ap.py b/ap.py index e88a375..b83deb1 100644 --- a/ap.py +++ b/ap.py @@ -516,4 +516,4 @@ if __name__ == '__main__': os.chmod(SOCKET_PATH, 0o660) try: shutil.chown(SOCKET_PATH, user='root', group='www-data') except (LookupError, OSError): os.chmod(SOCKET_PATH, 0o666) - print(f'API AP sur le socket {SOCKET_PATH} (aucun port TCP)'); server.serve_forever() + server.serve_forever() diff --git a/apache-ap.conf b/apache-ap.conf index 9d14813..002851a 100644 --- a/apache-ap.conf +++ b/apache-ap.conf @@ -18,3 +18,4 @@ ServerName localhost ErrorLog /dev/stderr CustomLog /dev/stdout combined + diff --git a/entrypoint.sh b/entrypoint.sh index 37ec50e..e63cea4 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -71,7 +71,7 @@ WEB_PID=$! trap 'log "Arrêt"; kill "$WEB_PID" "$API_PID" "$NM_PID" 2>/dev/null || true; exit 0' TERM INT -log "Interface web : http://:${AP_WEB_PORT}/ (API interne par socket, aucun port)" +log "Interface web : http://:${AP_WEB_PORT}/" wait -n log "Un service s'est arrêté, fermeture du conteneur" kill "$WEB_PID" "$API_PID" "$NM_PID" 2>/dev/null || true