feat: Adjust App & Docreader log output

This commit is contained in:
wizardchen
2025-09-11 23:08:13 +08:00
committed by lyingbug
parent 78088057fb
commit 74c121f7fb
7 changed files with 82 additions and 102 deletions
+5 -7
View File
@@ -39,7 +39,7 @@ WORKDIR /app
# Install runtime dependencies
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.tuna.tsinghua.edu.cn/g' /etc/apk/repositories && \
apk update && apk upgrade && \
apk add --no-cache build-base postgresql-client mysql-client ca-certificates tzdata sed curl bash supervisor vim wget
apk add --no-cache build-base postgresql-client mysql-client ca-certificates tzdata sed curl bash vim wget
# Copy the binary from the builder stage
COPY --from=builder /app/WeKnora .
@@ -55,10 +55,6 @@ COPY --from=builder /go/pkg/mod/github.com/yanyiwu /go/pkg/mod/github.com/yanyiw
# Make scripts executable
RUN chmod +x ./scripts/*.sh
# Setup supervisor configuration
RUN mkdir -p /etc/supervisor.d/
COPY docker/config/supervisord.conf /etc/supervisor.d/supervisord.conf
# Expose ports
EXPOSE 8080
@@ -70,5 +66,7 @@ RUN mkdir -p /data/files && \
adduser -D -g '' appuser && \
chown -R appuser:appuser /app /data/files
# Run supervisor instead of direct application start
CMD ["supervisord", "-c", "/etc/supervisor.d/supervisord.conf"]
# Switch to non-root user and run the application directly
USER appuser
CMD ["./WeKnora"]
+2 -7
View File
@@ -102,7 +102,6 @@ RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
antiword \
supervisor \
vim \
tar \
dpkg \
@@ -137,12 +136,8 @@ COPY --from=builder /app/src /app/src
ENV PYTHONPATH=/app/src
RUN cd /app/src && python -m download_deps
# 创建supervisor配置
RUN mkdir -p /etc/supervisor/conf.d
COPY services/docreader/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# 暴露 gRPC 端口
EXPOSE 50051
# 使用supervisor启动服务
CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
# 直接运行 Python 服务(日志输出到 stdout/stderr)
CMD ["python", "/app/src/server/server.py"]