unifare commited on
Commit ·
2742f74
1
Parent(s): 5278521
ff
Browse files- Dockerfile +8 -2
- supervisord.conf +1 -0
Dockerfile
CHANGED
|
@@ -15,6 +15,9 @@ RUN mkdir -p /var/log/supervisor /etc/supervisor/conf.d
|
|
| 15 |
# 复制supervisor配置文件
|
| 16 |
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 18 |
# 使用官方.NET 9.0 SDK镜像进行构建
|
| 19 |
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
| 20 |
WORKDIR /src
|
|
@@ -48,6 +51,9 @@ RUN chmod +x /app/start.sh
|
|
| 48 |
# 创建数据目录
|
| 49 |
RUN mkdir -p /app/data
|
| 50 |
|
|
|
|
|
|
|
|
|
|
| 51 |
# 设置环境变量
|
| 52 |
ENV ASPNETCORE_URLS=http://+:7860
|
| 53 |
ENV ASPNETCORE_ENVIRONMENT=Production
|
|
@@ -57,5 +63,5 @@ ENV DOTNET_RUNNING_IN_CONTAINER=true
|
|
| 57 |
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
| 58 |
CMD curl -f http://localhost:7860/ || exit 1
|
| 59 |
|
| 60 |
-
#
|
| 61 |
-
CMD ["/
|
|
|
|
| 15 |
# 复制supervisor配置文件
|
| 16 |
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
|
| 17 |
|
| 18 |
+
# 设置正确的权限
|
| 19 |
+
RUN chmod 755 /var/log/supervisor /etc/supervisor/conf.d
|
| 20 |
+
|
| 21 |
# 使用官方.NET 9.0 SDK镜像进行构建
|
| 22 |
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
|
| 23 |
WORKDIR /src
|
|
|
|
| 51 |
# 创建数据目录
|
| 52 |
RUN mkdir -p /app/data
|
| 53 |
|
| 54 |
+
# 设置目录权限
|
| 55 |
+
RUN chown -R root:root /app && chmod -R 755 /app
|
| 56 |
+
|
| 57 |
# 设置环境变量
|
| 58 |
ENV ASPNETCORE_URLS=http://+:7860
|
| 59 |
ENV ASPNETCORE_ENVIRONMENT=Production
|
|
|
|
| 63 |
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
| 64 |
CMD curl -f http://localhost:7860/ || exit 1
|
| 65 |
|
| 66 |
+
# 直接启动应用(不使用supervisor)
|
| 67 |
+
CMD ["/app/start.sh"]
|
supervisord.conf
CHANGED
|
@@ -3,6 +3,7 @@ nodaemon=true
|
|
| 3 |
user=root
|
| 4 |
logfile=/var/log/supervisor/supervisord.log
|
| 5 |
pidfile=/var/run/supervisord.pid
|
|
|
|
| 6 |
|
| 7 |
[program:toolhub]
|
| 8 |
command=/app/start.sh
|
|
|
|
| 3 |
user=root
|
| 4 |
logfile=/var/log/supervisor/supervisord.log
|
| 5 |
pidfile=/var/run/supervisord.pid
|
| 6 |
+
childlogdir=/var/log/supervisor
|
| 7 |
|
| 8 |
[program:toolhub]
|
| 9 |
command=/app/start.sh
|