FROM vectorim/element-web:latest # On passe en root temporairement pour modifier les fichiers protégés USER root # 1. On crée la configuration Nginx compatible Hugging Face RUN echo 'worker_processes 1; \ pid /tmp/nginx.pid; \ events { worker_connections 1024; } \ http { \ include /etc/nginx/mime.types; \ default_type application/octet-stream; \ client_body_temp_path /tmp/client_temp; \ proxy_temp_path /tmp/proxy_temp; \ fastcgi_temp_path /tmp/fastcgi_temp; \ uwsgi_temp_path /tmp/uwsgi_temp; \ scgi_temp_path /tmp/scgi_temp; \ server { \ listen 7860; \ server_name localhost; \ location / { \ root /app; \ index index.html; \ try_files $uri $uri/ /index.html; \ } \ } \ }' > /etc/nginx/nginx.conf # 2. On supprime les scripts qui bloquent le démarrage (maintenant qu'on est root) RUN rm -rf /docker-entrypoint.d/* # 3. On s'assure que l'utilisateur non-privilégié peut lire les fichiers de l'app RUN chmod -R 777 /tmp /var/cache/nginx /var/run /var/log/nginx # 4. On repasse en utilisateur non-privilégié (standard sur Hugging Face) USER 1000 # COPY config.json /app/config.json # COPY logo.png /app/res/themes/element/img/logos/facebook-logo.png EXPOSE 7860 CMD ["nginx", "-g", "daemon off;"]