madibaalbert commited on
Commit
5675651
·
verified ·
1 Parent(s): 94e35ba

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -8
Dockerfile CHANGED
@@ -1,18 +1,39 @@
1
  FROM vectorim/element-web:latest
2
 
3
- # 1. On change le port par défaut pour le port 7860 de Hugging Face
4
- RUN sed -i 's/listen[[:space:]]*80;/listen 7860;/g' /etc/nginx/conf.d/default.conf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
 
6
- # 2. On configure Nginx pour utiliser /tmp au lieu des dossiers protégés
7
- # Cela évite les erreurs de permissions sur /var/run et /var/cache
8
- RUN sed -i 's|/var/run/nginx.pid|/tmp/nginx.pid|g' /etc/nginx/nginx.conf && \
9
- sed -i '/http {/a \ client_body_temp_path /tmp/client_temp;\n proxy_temp_path /tmp/proxy_temp;\n fastcgi_temp_path /tmp/fastcgi_temp;\n uwsgi_temp_path /tmp/uwsgi_temp;\n scgi_temp_path /tmp/scgi_temp;' /etc/nginx/nginx.conf
10
 
11
- # 3. Facultatif : Si tu as un fichier config.json ou un logo, décommente ces lignes
 
 
 
12
  # COPY config.json /app/config.json
13
  # COPY logo.png /app/res/themes/element/img/logos/facebook-logo.png
14
 
15
  EXPOSE 7860
16
 
17
- # Nginx démarrera sans avoir besoin des droits root
18
  CMD ["nginx", "-g", "daemon off;"]
 
1
  FROM vectorim/element-web:latest
2
 
3
+ # 1. On crée un fichier de configuration Nginx minimal et propre
4
+ # Cela évite les doublons et les problèmes de permissions
5
+ RUN echo 'worker_processes 1; \
6
+ events { worker_connections 1024; } \
7
+ http { \
8
+ include /etc/nginx/mime.types; \
9
+ default_type application/octet-stream; \
10
+ client_body_temp_path /tmp/client_temp; \
11
+ proxy_temp_path /tmp/proxy_temp; \
12
+ fastcgi_temp_path /tmp/fastcgi_temp; \
13
+ uwsgi_temp_path /tmp/uwsgi_temp; \
14
+ scgi_temp_path /tmp/scgi_temp; \
15
+ server { \
16
+ listen 7860; \
17
+ server_name localhost; \
18
+ location / { \
19
+ root /app; \
20
+ index index.html; \
21
+ try_files $uri $uri/ /index.html; \
22
+ } \
23
+ } \
24
+ }' > /etc/nginx/nginx.conf
25
 
26
+ # 2. On s'assure que le fichier PID est aussi dans /tmp
27
+ RUN sed -i "1i pid /tmp/nginx.pid;" /etc/nginx/nginx.conf
 
 
28
 
29
+ # 3. Supprimer les scripts d'entrée par défaut qui causent les erreurs de doublons
30
+ RUN rm -rf /docker-entrypoint.d/*
31
+
32
+ # 4. Copie de tes fichiers personnalisés (décommente si tu les as ajoutés dans ton Space)
33
  # COPY config.json /app/config.json
34
  # COPY logo.png /app/res/themes/element/img/logos/facebook-logo.png
35
 
36
  EXPOSE 7860
37
 
38
+ # Lancer Nginx directement
39
  CMD ["nginx", "-g", "daemon off;"]