sanbo commited on
Commit
0f70032
·
1 Parent(s): 682d976

update sth. at 2024-10-30 12:04:06

Browse files
Files changed (2) hide show
  1. Dockerfile.txt → Dockerfile +6 -6
  2. nginx.conf +1 -1
Dockerfile.txt → Dockerfile RENAMED
@@ -1,17 +1,17 @@
1
  # 基于 duck2api 镜像
2
  FROM ghcr.io/aurora-develop/duck2api:latest
3
 
4
- # 安装 nginx 和 socat(如必要)
5
  RUN apk add --no-cache nginx socat
6
 
7
  # 创建 nginx 配置目录和日志目录
8
  RUN mkdir -p /var/log/nginx /etc/nginx/conf.d
9
 
10
- # 配置 nginx
11
  COPY nginx.conf /etc/nginx/nginx.conf
12
 
13
- # 暴露 Hugging Face 使用的端口 7680
14
- EXPOSE 7680
15
 
16
- # 启动 nginx 代理和 duck2api 服务
17
- CMD socat TCP-LISTEN:7680,fork TCP:localhost:8080 & nginx && /app/duck2api
 
1
  # 基于 duck2api 镜像
2
  FROM ghcr.io/aurora-develop/duck2api:latest
3
 
4
+ # 安装 nginx 和 socat(端口映射工具)
5
  RUN apk add --no-cache nginx socat
6
 
7
  # 创建 nginx 配置目录和日志目录
8
  RUN mkdir -p /var/log/nginx /etc/nginx/conf.d
9
 
10
+ # 拷贝 nginx 配置文件
11
  COPY nginx.conf /etc/nginx/nginx.conf
12
 
13
+ # 暴露 Hugging Face 必须使用的端口 7860
14
+ EXPOSE 7860
15
 
16
+ # 启动 nginx 并将 7860 端口代理到应用的 8080 端口
17
+ CMD socat TCP-LISTEN:7860,fork TCP:localhost:8080 & nginx && /app/duck2api
nginx.conf CHANGED
@@ -8,7 +8,7 @@ http {
8
  error_log /var/log/nginx/error.log;
9
 
10
  server {
11
- listen 7680;
12
  server_name localhost;
13
 
14
  location / {
 
8
  error_log /var/log/nginx/error.log;
9
 
10
  server {
11
+ listen 7860;
12
  server_name localhost;
13
 
14
  location / {