chore: 基础镜像中安装excalidraw

This commit is contained in:
jmal 2025-01-18 13:50:08 +08:00
parent e7c8fa63d9
commit aadc5cb490
3 changed files with 31 additions and 0 deletions

View File

@ -5,8 +5,11 @@ RUN apt-get update && \
mkdir -p /etc/nginx/servers /var/www && \
wget https://github.com/jgraph/drawio/releases/download/v24.4.10/draw.war -O /var/www/draw.war && \
wget https://github.com/mozilla/pdf.js/releases/download/v4.3.136/pdfjs-4.3.136-dist.zip -O /var/www/pdfjs.zip && \
wget https://github.com/jamebal/excalidraw/releases/download/v0.17.3/build.tar.gz -O /var/www/excalidraw.tar.gz && \
mkdir -p /var/www/excalidraw && \
unzip /var/www/draw.war -d /var/www/draw && \
unzip /var/www/pdfjs.zip -d /var/www/pdfjs && \
tar -xvf /var/www/excalidraw.tar.gz -C /var/www/excalidraw && \
rm -rf /var/www/pdfjs.zip /var/www/draw.war /var/www/draw/META-INF /var/www/draw/WEB-INF && \
apt-get remove -y unzip wget && \
apt-get autoremove -y && \

View File

@ -0,0 +1,10 @@
server {
listen 8082;
server_name localhost;
root /var/www/excalidraw;
client_max_body_size 100m;
location / {
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
}

View File

@ -243,6 +243,24 @@ http {
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location /excalidraw/app/ {
proxy_pass http://localhost:8082/excalidraw/app/;
proxy_http_version 1.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Real-PORT $remote_port;
proxy_set_header X-Forwarded-Host $the_host//excalidraw/app/;
proxy_set_header X-Forwarded-Proto $the_scheme;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header Scheme $scheme;
proxy_set_header Server-Protocol $server_protocol;
proxy_set_header Server-Name $server_name;
proxy_set_header Server-Addr $server_addr;
proxy_set_header Server-Port $server_port;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
}
}
include servers/*;