Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +29 -8
Dockerfile
CHANGED
|
@@ -1,18 +1,39 @@
|
|
| 1 |
FROM vectorim/element-web:latest
|
| 2 |
|
| 3 |
-
# 1. On
|
| 4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
|
| 6 |
-
# 2. On
|
| 7 |
-
|
| 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.
|
|
|
|
|
|
|
|
|
|
| 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
|
| 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;"]
|