lushuncheng 6 years ago
parent
commit
cf32a4f15c
4 changed files with 8 additions and 1 deletions
  1. 3 0
      dockerfile/common.yml
  2. 2 0
      shell/container-up.sh
  3. 1 1
      shell/nginx-up.sh
  4. 2 0
      shell/proginn-script-up.sh

+ 3 - 0
dockerfile/common.yml

@@ -4,6 +4,7 @@ services:
     image: "registry.cn-beijing.aliyuncs.com/lscgzwd/ubuntu18.04-php7:latest"
     restart: always
     command: /data/docker/shell/nginx-up.sh
+    container_name: nginx
     ports:
       - "8888:80"
     networks:
@@ -18,6 +19,7 @@ services:
   mongodb:
     restart: always
     image: mongo:3.5
+    container_name: mongodb
     volumes:
       - /workspace/commonContainers/mongodb/:/data/
     networks:
@@ -26,6 +28,7 @@ services:
   apidoc:
     restart: always
     image: branchzero/yapi
+    container_name: apidoc
     command: /bin/bash -c "[ ! -e /home/yapi/log/init.lock ] && npm run install-server && touch /home/yapi/log/init.lock; npm run start"
     volumes:
       - /workspace/commonContainers/yapi/log:/home/yapi/log

+ 2 - 0
shell/container-up.sh

@@ -3,6 +3,7 @@ echo "Asia/Shanghai" > /etc/timezone
 
 # 写入环境变量
 if grep -q -w "PROGINN_FRONTEND_BRANCH" /etc/environment; then
+    echo "already changed env."
 else
     echo "ENV=test" >> /etc/environment
     echo "PROGINN_BRANCH=$PROGINN_BRANCH" >> /etc/environment
@@ -60,6 +61,7 @@ ulimit -Hu 1048576
 ulimit -Su 1048576
 ulimit -S -c unlimited
 if grep -q -w "nofile          1048576" /etc/security/limits.conf; then
+    echo "already changed limit."
 else
     sed -i "55a *               soft    nofile          1048576\n*               hard    nofile          1048576" /etc/security/limits.conf
 fi

+ 1 - 1
shell/nginx-up.sh

@@ -10,10 +10,10 @@ ln -f -s /data/docker/config/nginx/conf.d/git.conf /etc/nginx/sites-enabled/git.
 # ulimit
 ulimit -Hn 1048576
 ulimit -Sn 1048576
-ulimit -Hu 1048576
 ulimit -Su 1048576
 ulimit -S -c unlimited
 if grep -q -w "nofile          1048576" /etc/security/limits.conf; then
+    echo "already changed limit."
 else
     sed -i "55a *               soft    nofile          1048576\n*               hard    nofile          1048576" /etc/security/limits.conf
 fi

+ 2 - 0
shell/proginn-script-up.sh

@@ -3,6 +3,7 @@
 echo "Asia/Shanghai" > /etc/timezone
 # 写入环境变量
 if grep -q -w "PROGINN_BRANCH" /etc/environment; then
+    echo "already changed env."
 else
     echo "ENV=test" >> /etc/environment
     echo "PROGINN_BRANCH=$PROGINN_BRANCH" >> /etc/environment
@@ -25,6 +26,7 @@ ulimit -Hu 1048576
 ulimit -Su 1048576
 ulimit -S -c unlimited
 if grep -q -w "nofile          1048576" /etc/security/limits.conf; then
+    echo "already changed limit."
 else
     sed -i "55a *               soft    nofile          1048576\n*               hard    nofile          1048576" /etc/security/limits.conf
 fi