ccyyss commited on
Commit
08af3d2
·
verified ·
1 Parent(s): 4e9f915

deploy MinIO (nginx mux, secrets-based root creds)

Browse files
Files changed (4) hide show
  1. Dockerfile +22 -0
  2. README.md +9 -5
  3. index.html +26 -0
  4. nginx.conf +60 -0
Dockerfile CHANGED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # MinIO + nginx on HF Docker Space (single exposed port 8080)
2
+ FROM debian:bookworm-slim
3
+
4
+ RUN apt-get update && \
5
+ apt-get install -y nginx curl && \
6
+ apt-get clean && \
7
+ rm -rf /var/lib/apt/lists/*
8
+
9
+ # MinIO binary pinned to a release that still ships the embedded console
10
+ COPY --from=quay.io/minio/minio:RELEASE.2025-04-22T22-12-26Z /usr/bin/minio /usr/bin/minio
11
+
12
+ # Root credentials come from Space Secrets at runtime:
13
+ # MINIO_ROOT_USER / MINIO_ROOT_PASSWORD (do NOT hardcode here)
14
+
15
+ RUN mkdir -p /data && chmod -R 777 /data
16
+
17
+ COPY nginx.conf /etc/nginx/nginx.conf
18
+ COPY index.html /usr/share/nginx/html/index.html
19
+
20
+ EXPOSE 8080
21
+
22
+ CMD ["sh", "-c", "minio server /data --address :9000 --console-address :9001 & nginx -g 'daemon off;'"]
README.md CHANGED
@@ -1,10 +1,14 @@
1
  ---
2
- title: Ffooxx
3
- emoji: 🌍
4
- colorFrom: indigo
5
- colorTo: pink
6
  sdk: docker
7
  pinned: false
 
 
8
  ---
9
 
10
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
 
 
1
  ---
2
+ title: Minio
3
+ emoji: ⚡
4
+ colorFrom: yellow
5
+ colorTo: green
6
  sdk: docker
7
  pinned: false
8
+ short_description: S3 云存储
9
+ app_port: 8080
10
  ---
11
 
12
+ MinIO (S3-compatible object storage) on a Hugging Face Docker Space.
13
+ Root credentials are provided via Space Secrets (MINIO_ROOT_USER / MINIO_ROOT_PASSWORD), never in this repo.
14
+ Data directory /data — attach a Storage Bucket mounted at /data for persistence across restarts.
index.html ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html lang="zh-CN">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>MinIO Service Hub</title>
7
+ <style>
8
+ :root { --primary-color: #3872ff; --bg-color: #f4f7f6; --text-color: #333; }
9
+ body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; text-align: center; padding: 0; margin: 0; background: var(--bg-color); display: flex; justify-content: center; align-items: center; height: 100vh; }
10
+ .card { background: white; padding: 40px; border-radius: 12px; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05); max-width: 400px; width: 90%; }
11
+ h1 { color: var(--primary-color); font-size: 24px; margin-bottom: 10px; }
12
+ p { color: #666; line-height: 1.6; margin-bottom: 30px; }
13
+ .btn { display: inline-block; padding: 12px 24px; background: var(--primary-color); color: white; text-decoration: none; border-radius: 6px; font-weight: 600; transition: background 0.3s ease; }
14
+ .btn:hover { background: #2956cc; }
15
+ .status-tag { display: inline-block; padding: 4px 12px; background: #e6fffa; color: #38a169; border-radius: 20px; font-size: 12px; font-weight: bold; margin-bottom: 20px; }
16
+ </style>
17
+ </head>
18
+ <body>
19
+ <div class="card">
20
+ <div class="status-tag">● 系统运行中</div>
21
+ <h1>MinIO 存储服务</h1>
22
+ <p>S3 API 节点已就绪。根路径为 S3 API 入口,管理请进入控制台。</p>
23
+ <a href="/browser/" target="_top" class="btn">进入管理控制台 (Console)</a>
24
+ </div>
25
+ </body>
26
+ </html>
nginx.conf ADDED
@@ -0,0 +1,60 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ events {
2
+ worker_connections 1024;
3
+ }
4
+
5
+ http {
6
+ client_max_body_size 500M;
7
+
8
+ include /etc/nginx/mime.types;
9
+ default_type application/octet-stream;
10
+
11
+ server {
12
+ listen 8080;
13
+
14
+ root /usr/share/nginx/html;
15
+
16
+ # Root: welcome page for browsers, S3 API for everything else
17
+ location / {
18
+ if ($http_accept ~* "text/html") {
19
+ rewrite ^/$ /index.html last;
20
+ }
21
+
22
+ proxy_set_header Host $http_host;
23
+ proxy_set_header X-Real-IP $remote_addr;
24
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
25
+ proxy_set_header X-Forwarded-Proto $scheme;
26
+
27
+ proxy_connect_timeout 300;
28
+ proxy_send_timeout 300;
29
+ proxy_read_timeout 300;
30
+
31
+ proxy_http_version 1.1;
32
+ proxy_set_header Connection "";
33
+ chunked_transfer_encoding off;
34
+
35
+ proxy_pass http://localhost:9000;
36
+ }
37
+
38
+ location = /index.html {
39
+ root /usr/share/nginx/html;
40
+ }
41
+
42
+ # MinIO Console
43
+ location /browser/ {
44
+ client_max_body_size 500M;
45
+ rewrite ^/browser/(.*) /$1 break;
46
+
47
+ proxy_set_header Host $http_host;
48
+ proxy_set_header X-Real-IP $remote_addr;
49
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
50
+ proxy_set_header X-Forwarded-Proto $scheme;
51
+ proxy_set_header X-NginX-Proxy true;
52
+
53
+ proxy_http_version 1.1;
54
+ proxy_set_header Upgrade $http_upgrade;
55
+ proxy_set_header Connection "upgrade";
56
+
57
+ proxy_pass http://localhost:9001/;
58
+ }
59
+ }
60
+ }