sanbo commited on
Commit ·
d7994b2
1
Parent(s): cab5ebe
update sth. at 2024-10-30 12:08:53
Browse files- Dockerfile +4 -4
Dockerfile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 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 所需的目录并赋予权限
|
|
@@ -14,8 +14,8 @@ RUN mkdir -p /var/log/nginx /etc/nginx/conf.d
|
|
| 14 |
# 拷贝 nginx 配置文件
|
| 15 |
COPY nginx.conf /etc/nginx/nginx.conf
|
| 16 |
|
| 17 |
-
# 暴露
|
| 18 |
EXPOSE 7860
|
| 19 |
|
| 20 |
-
# 启动
|
| 21 |
-
CMD socat TCP-LISTEN:7860,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 所需的目录并赋予权限
|
|
|
|
| 14 |
# 拷贝 nginx 配置文件
|
| 15 |
COPY nginx.conf /etc/nginx/nginx.conf
|
| 16 |
|
| 17 |
+
# 暴露端口 7860
|
| 18 |
EXPOSE 7860
|
| 19 |
|
| 20 |
+
# 启动命令,增加日志输出
|
| 21 |
+
CMD (socat TCP-LISTEN:7860,fork TCP:localhost:8080 & nginx && echo "nginx started" && /app/duck2api) || (echo "Service failed to start" && tail -f /var/log/nginx/error.log)
|