Deep-sea commited on
Commit
5ec0319
·
verified ·
1 Parent(s): 140adc1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -9
Dockerfile CHANGED
@@ -14,14 +14,9 @@ RUN apk add --no-cache nginx php82 php82-fpm php82-opcache pcre gnu-libiconv oni
14
  chown -R root:root /var/lib/nginx && \
15
  chmod -R 755 /var/lib/nginx
16
 
17
- # 下载 Filegator 单文件
18
- RUN wget -q https://github.com/filegator/filegator/releases/latest/download/filegator.zip -O /tmp/filegator.zip && \
19
- unzip -q /tmp/filegator.zip -d /usr/share/nginx/html/ && \
20
- mv /usr/share/nginx/html/filegator-* /usr/share/nginx/html/filegator && \
21
- rm -f /tmp/filegator.zip && \
22
- chown -R root:root /usr/share/nginx/html/filegator && \
23
- chmod -R 755 /usr/share/nginx/html/filegator || \
24
- { echo "Failed to download or configure Filegator"; exit 1; }
25
 
26
  # 确保 Gitea 配置目录和数据目录权限
27
  RUN mkdir -p /data/gitea/conf && \
@@ -45,7 +40,7 @@ ENV GITEA__database__DB_TYPE=sqlite3 \
45
  USER=git
46
 
47
  # 配置 Nginx
48
- RUN echo 'user root; events {} http { server { listen 7860; location / { proxy_pass http://localhost:3000; proxy_set_header Host $host; } location /files/ { alias /usr/share/nginx/html/filegator/public/; index index.php; try_files $uri $uri/ /files/index.php?$args; location ~ \.php$ { fastcgi_pass unix:/run/php/php8.2-fpm.sock; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param HTTPS on; } } error_log /var/lib/nginx/logs/error.log; access_log /var/lib/nginx/logs/access.log; client_max_body_size 50m; } }' > /etc/nginx/nginx.conf
49
 
50
  # 嵌入 entrypoint 逻辑
51
  COPY --chown=root:root <<'EOF' /entrypoint.sh
 
14
  chown -R root:root /var/lib/nginx && \
15
  chmod -R 755 /var/lib/nginx
16
 
17
+ # 下载 Tiny File Manager 单文件
18
+ RUN wget -q https://raw.githubusercontent.com/prasathmani/tinyfilemanager/master/tinyfilemanager.php -O /usr/share/nginx/html/filemanager.php || \
19
+ { echo "Failed to download filemanager.php"; exit 1; }
 
 
 
 
 
20
 
21
  # 确保 Gitea 配置目录和数据目录权限
22
  RUN mkdir -p /data/gitea/conf && \
 
40
  USER=git
41
 
42
  # 配置 Nginx
43
+ RUN echo 'user root; events {} http { server { listen 7860; location / { proxy_pass http://localhost:3000; proxy_set_header Host $host; } location /files/ { alias /usr/share/nginx/html/; index filemanager.php; try_files $uri $uri/ /files/filemanager.php?$args; location ~ \.php$ { fastcgi_pass unix:/run/php/php8.2-fpm.sock; fastcgi_index filemanager.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $request_filename; fastcgi_param HTTPS on; } } error_log /var/lib/nginx/logs/error.log; access_log /var/lib/nginx/logs/access.log; client_max_body_size 50m; } }' > /etc/nginx/nginx.conf
44
 
45
  # 嵌入 entrypoint 逻辑
46
  COPY --chown=root:root <<'EOF' /entrypoint.sh