Spaces:
Building
Building
github-actions[bot]
commited on
Commit
·
aa210ed
1
Parent(s):
9942962
Update from GitHub Actions
Browse files- Dockerfile +18 -5
- app/index.html +17 -7
- nginx.conf +7 -2
Dockerfile
CHANGED
@@ -1,17 +1,30 @@
|
|
1 |
-
# 使用官方nginx镜像作为基础镜像
|
2 |
FROM nginx:alpine
|
3 |
|
4 |
# 安装基本工具
|
5 |
RUN apk add --no-cache curl
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
# 复制 nginx 配置文件
|
8 |
COPY nginx.conf /etc/nginx/nginx.conf
|
9 |
|
10 |
-
# 创建网站目录
|
11 |
-
RUN mkdir -p /usr/share/nginx/html
|
12 |
-
|
13 |
# 复制网站文件(假设你的网站文件在 src 目录下)
|
14 |
-
COPY
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
# 暴露80端口
|
17 |
EXPOSE 7860
|
|
|
1 |
+
# 使用官方 nginx 镜像作为基础镜像
|
2 |
FROM nginx:alpine
|
3 |
|
4 |
# 安装基本工具
|
5 |
RUN apk add --no-cache curl
|
6 |
|
7 |
+
# 创建必要的目录并设置权限
|
8 |
+
RUN mkdir -p /var/cache/nginx \
|
9 |
+
&& mkdir -p /var/run \
|
10 |
+
&& mkdir -p /var/log/nginx \
|
11 |
+
&& mkdir -p /usr/share/nginx/html \
|
12 |
+
&& chown -R nginx:nginx /var/cache/nginx \
|
13 |
+
&& chown -R nginx:nginx /var/run \
|
14 |
+
&& chown -R nginx:nginx /var/log/nginx \
|
15 |
+
&& chown -R nginx:nginx /usr/share/nginx/html
|
16 |
+
|
17 |
# 复制 nginx 配置文件
|
18 |
COPY nginx.conf /etc/nginx/nginx.conf
|
19 |
|
|
|
|
|
|
|
20 |
# 复制网站文件(假设你的网站文件在 src 目录下)
|
21 |
+
COPY src/ /usr/share/nginx/html/
|
22 |
+
|
23 |
+
# 修改配置文件权限
|
24 |
+
RUN chown -R nginx:nginx /etc/nginx/nginx.conf
|
25 |
+
|
26 |
+
# 切换到非 root 用户
|
27 |
+
USER nginx
|
28 |
|
29 |
# 暴露80端口
|
30 |
EXPOSE 7860
|
app/index.html
CHANGED
@@ -1,9 +1,19 @@
|
|
1 |
|
2 |
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
|
2 |
|
3 |
+
<!DOCTYPE html>
|
4 |
+
<html>
|
5 |
+
<head>
|
6 |
+
<title>Welcome to My Hugging Face Space</title>
|
7 |
+
</head>
|
8 |
+
<body>
|
9 |
+
|
10 |
+
https://api.crazy4.me/gemini/v1/{path} https://generativelanguage.googleapis.com/v1/{path}
|
11 |
+
https://api.crazy4.me/gemini/v1beta/{path} https://generativelanguage.googleapis.com/v1beta/{path}
|
12 |
+
https://api.crazy4.me/groq/openai/v1/{path} https://api.groq.com/openai/v1/{path}
|
13 |
+
https://api.crazy4.me/cohere/v1/{path} https://api.cohere.ai/v1/{path}
|
14 |
+
https://api.crazy4.me/xai/v1/{path} https://api.x.ai/v1/{path}
|
15 |
+
https://api.crazy4.me/mistral/v1/{path} https://api.mistral.ai/v1/{path}
|
16 |
+
https://api.crazy4.me/github/v1/{path} https://models.inference.ai.azure.com/{path}
|
17 |
+
|
18 |
+
</body>
|
19 |
+
</html>
|
nginx.conf
CHANGED
@@ -1,4 +1,3 @@
|
|
1 |
-
user nginx;
|
2 |
worker_processes auto;
|
3 |
|
4 |
error_log /var/log/nginx/error.log warn;
|
@@ -18,6 +17,12 @@ http {
|
|
18 |
|
19 |
access_log /var/log/nginx/access.log main;
|
20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
sendfile on;
|
22 |
keepalive_timeout 65;
|
23 |
|
@@ -28,7 +33,7 @@ http {
|
|
28 |
gzip_proxied any;
|
29 |
gzip_comp_level 6;
|
30 |
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
31 |
-
|
32 |
server {
|
33 |
listen 7860;
|
34 |
server_name localhost;
|
|
|
|
|
1 |
worker_processes auto;
|
2 |
|
3 |
error_log /var/log/nginx/error.log warn;
|
|
|
17 |
|
18 |
access_log /var/log/nginx/access.log main;
|
19 |
|
20 |
+
client_body_temp_path /var/cache/nginx/client_temp;
|
21 |
+
proxy_temp_path /var/cache/nginx/proxy_temp;
|
22 |
+
fastcgi_temp_path /var/cache/nginx/fastcgi_temp;
|
23 |
+
uwsgi_temp_path /var/cache/nginx/uwsgi_temp;
|
24 |
+
scgi_temp_path /var/cache/nginx/scgi_temp;
|
25 |
+
|
26 |
sendfile on;
|
27 |
keepalive_timeout 65;
|
28 |
|
|
|
33 |
gzip_proxied any;
|
34 |
gzip_comp_level 6;
|
35 |
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
|
36 |
+
|
37 |
server {
|
38 |
listen 7860;
|
39 |
server_name localhost;
|