Browse Source

build:优化 Dockerfile 中的入口点设置

- 将 './'${APP_NAME}' "$@"' 替换为 'exec ./'${APP_NAME}' "$@"'
- 使用 exec 可以确保容器的信号直接传递给应用进程,提高可靠性
fusu 2 months ago
parent
commit
c296057c7e
1 changed files with 1 additions and 1 deletions
  1. 1 1
      deploy/build/Dockerfile

+ 1 - 1
deploy/build/Dockerfile

@@ -42,7 +42,7 @@ COPY --from=builder /data/app/bin /data/app
 EXPOSE 8000
 # 在构建阶段设置ENTRYPOINT,支持通过APP_CONF环境变量指定配置文件
 RUN echo '#!/bin/sh' > /data/app/entrypoint.sh && \
-    echo './'${APP_NAME}' "$@"' >> /data/app/entrypoint.sh && \
+    echo 'exec ./'${APP_NAME}' "$@"' >> /data/app/entrypoint.sh && \
     chmod +x /data/app/entrypoint.sh
 ENTRYPOINT [ "./entrypoint.sh" ]