sshinmen commited on
Commit
664654c
·
1 Parent(s): aab0db3

Fix HF Space deployment: add config.yaml, expose port 7860, add cloud deploy mode

Browse files
Files changed (2) hide show
  1. Dockerfile +6 -1
  2. config.yaml +52 -0
Dockerfile CHANGED
@@ -23,12 +23,17 @@ RUN mkdir /CLIProxyAPI
23
  COPY --from=builder ./app/CLIProxyAPI /CLIProxyAPI/CLIProxyAPI
24
 
25
  COPY config.example.yaml /CLIProxyAPI/config.example.yaml
 
26
 
27
  WORKDIR /CLIProxyAPI
28
 
29
- EXPOSE 8317
 
 
30
 
31
  ENV TZ=Asia/Shanghai
 
 
32
 
33
  RUN cp /usr/share/zoneinfo/${TZ} /etc/localtime && echo "${TZ}" > /etc/timezone
34
 
 
23
  COPY --from=builder ./app/CLIProxyAPI /CLIProxyAPI/CLIProxyAPI
24
 
25
  COPY config.example.yaml /CLIProxyAPI/config.example.yaml
26
+ COPY config.yaml /CLIProxyAPI/config.yaml
27
 
28
  WORKDIR /CLIProxyAPI
29
 
30
+ RUN mkdir -p /CLIProxyAPI/auths
31
+
32
+ EXPOSE 7860
33
 
34
  ENV TZ=Asia/Shanghai
35
+ ENV DEPLOY=cloud
36
+ ENV PORT=7860
37
 
38
  RUN cp /usr/share/zoneinfo/${TZ} /etc/localtime && echo "${TZ}" > /etc/timezone
39
 
config.yaml ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Server host/interface to bind to. Default is empty ("") to bind all interfaces (IPv4 + IPv6).
2
+ host: ""
3
+
4
+ # Server port - HF Spaces requires port 7860
5
+ port: 7860
6
+
7
+ # TLS settings for HTTPS. When enabled, the server listens with the provided certificate and key.
8
+ tls:
9
+ enable: false
10
+ cert: ""
11
+ key: ""
12
+
13
+ # Management API settings
14
+ remote-management:
15
+ # Whether to allow remote (non-localhost) management access.
16
+ allow-remote: true
17
+
18
+ # Management key. If a plaintext value is provided here, it will be hashed on startup.
19
+ # Set via environment variable or update this for production use.
20
+ secret-key: ""
21
+
22
+ # Disable the bundled management control panel asset download and HTTP route when true.
23
+ disable-control-panel: false
24
+
25
+ # GitHub repository for the management control panel.
26
+ panel-github-repository: "https://github.com/router-for-me/Cli-Proxy-API-Management-Center"
27
+
28
+ # Authentication directory
29
+ auth-dir: "/CLIProxyAPI/auths"
30
+
31
+ # API keys for authentication - add your keys here
32
+ api-keys:
33
+ - "demo-key-change-in-production"
34
+
35
+ # Enable debug logging
36
+ debug: false
37
+
38
+ # Commercial mode for high concurrency
39
+ commercial-mode: false
40
+
41
+ # When true, write application logs to rotating files instead of stdout
42
+ logging-to-file: false
43
+
44
+ # Maximum total size (MB) of log files under the logs directory
45
+ logs-max-total-size-mb: 100
46
+
47
+ # Usage statistics
48
+ usage-statistics-enabled: false
49
+
50
+ # Request retry settings
51
+ request-retry: 3
52
+ max-retry-interval: 30