Kaynağa Gözat

修复docker镜像测试

kindring 2 yıl önce
ebeveyn
işleme
cf3b96de9c
2 değiştirilmiş dosya ile 5 ekleme ve 4 silme
  1. 2 1
      Dockerfile
  2. 3 3
      test.sh

+ 2 - 1
Dockerfile

@@ -6,10 +6,11 @@ COPY build ./build
 COPY config ./conf
 COPY test.sh ./
 RUN mkdir ./config/
+RUN chmod +x ./test.sh
 # 容器对外暴露的端口号
 EXPOSE 8090
 
-ENTRYPOINT ['test.sh']
+ENTRYPOINT ["./test.sh"]
 # 容器启动时执行的命令,类似npm run start
 
 CMD ["npm", "start"]

+ 3 - 3
test.sh

@@ -1,16 +1,16 @@
 #!/bin/sh
 if [ ! -f "./configs/Server.json" ];
 then
-  cp /conf/Server.json /configs/Server.json
+  cp ./conf/Server.json ./configs/Server.json
   echo "Server.json copied from /conf to /configs"
 fi
 if [ ! -f "./configs/file.json" ];
 then
-  cp /conf/file.json /configs/file.json
+  cp ./conf/file.json ./configs/file.json
   echo "file.json copied from /conf to /configs"
 fi
 if [ ! -f "./configs/Custom.json" ];
 then
-  cp /conf/Custom.json /configs/Custom.json
+  cp ./conf/Custom.json ./configs/Custom.json
   echo "file.json copied from /conf to /configs"
 fi