orztv
commited on
Commit
·
763ae56
1
Parent(s):
ba967e7
update
Browse files- Dockerfile +3 -18
- docker/startup.sh +22 -0
Dockerfile
CHANGED
@@ -9,24 +9,9 @@ ARG NC_S3_ACCESS_SECRET
|
|
9 |
# 创建数据目录并设置适当的权限
|
10 |
RUN mkdir -p /usr/app/data && chown -R 1000:1000 /usr/app /usr/src/app /usr
|
11 |
|
12 |
-
#
|
13 |
-
|
14 |
-
|
15 |
-
whoami\n\
|
16 |
-
cat /etc/passwd\n\
|
17 |
-
echo "\nPython 版本:"\n\
|
18 |
-
python --version\n\
|
19 |
-
which python\n\
|
20 |
-
echo "\nNode.js 版本:"\n\
|
21 |
-
node --version\n\
|
22 |
-
which node\n\
|
23 |
-
echo "\n系统信息:"\n\
|
24 |
-
cat /etc/os-release\n\
|
25 |
-
echo "\n/usr/src/appEntry/start.sh 内容:"\n\
|
26 |
-
cat /usr/src/appEntry/start.sh\n\
|
27 |
-
echo "\n启动主程序..."\n\
|
28 |
-
exec /usr/src/appEntry/start.sh\n\
|
29 |
-
' > /usr/src/appEntry/startup.sh && chmod +x /usr/src/appEntry/startup.sh
|
30 |
|
31 |
# 切换到非 root 用户
|
32 |
USER 1000
|
|
|
9 |
# 创建数据目录并设置适当的权限
|
10 |
RUN mkdir -p /usr/app/data && chown -R 1000:1000 /usr/app /usr/src/app /usr
|
11 |
|
12 |
+
# 复制启动脚本并设置权限
|
13 |
+
COPY docker/startup.sh /usr/src/appEntry/startup.sh
|
14 |
+
RUN chmod +x /usr/src/appEntry/startup.sh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
# 切换到非 root 用户
|
17 |
USER 1000
|
docker/startup.sh
ADDED
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#!/bin/sh
|
2 |
+
|
3 |
+
echo "当前用户:"
|
4 |
+
whoami
|
5 |
+
cat /etc/passwd
|
6 |
+
|
7 |
+
echo "\nPython 版本:"
|
8 |
+
python --version
|
9 |
+
which python
|
10 |
+
|
11 |
+
echo "\nNode.js 版本:"
|
12 |
+
node --version
|
13 |
+
which node
|
14 |
+
|
15 |
+
echo "\n系统信息:"
|
16 |
+
cat /etc/os-release
|
17 |
+
|
18 |
+
echo "\n/usr/src/appEntry/start.sh 内容:"
|
19 |
+
cat /usr/src/appEntry/start.sh
|
20 |
+
|
21 |
+
echo "\n启动主程序..."
|
22 |
+
exec /usr/src/appEntry/start.sh
|