Bladeren bron

上传文件至 ''

chenxixian 6 jaren geleden
bovenliggende
commit
06bc9adfdb
5 gewijzigde bestanden met toevoegingen van 125 en 1 verwijderingen
  1. 53 1
      README.md
  2. 4 0
      build.sh
  3. 52 0
      default.conf
  4. 8 0
      setup.sh
  5. 8 0
      www.sh

+ 53 - 1
README.md

@@ -1,2 +1,54 @@
-# imgurl
+# imgurl for Docker
+
+## 自建版本
+
+### 镜像构建
+
+```
+git clone http://gitlab.sgmw.com.cn/chenxixian/imgurl.git
+cd imgurl
+docker build -t samchenxx/imgurl:1.0.0 .
+```
+
+### 容器运行
+
+```
+docker run --restart=always --name imgurl --privileged -dti -p 80:80 samchenxx/imgurl:1.0.0
+```
+
+### 镜像打包(为了离线安装)
+
+```
+docker save -o samchenxx-imgurl.tar samchenxx/imgurl:1.0.0
+```
+
+### 镜像加载(为了离线安装)
+
+```
+docker load -i samchenxx-imgurl.tar 
+```
+
+## 官方版本
+
+
+### 镜像构建和打包(为了离线安装)
+
+```
+git clone http://gitlab.sgmw.com.cn/chenxixian/imgurl.git
+cd imgurl
+./build.sh
+```
+
+### 容器运行
+
+如果紧接上一步,可以直接执行;
+
+如果需要离线安装,先把上一步打包好的文件(helloxz-imgurl.tar)scp到服务器imgurl路径(git clone http://gitlab.sgmw.com.cn/chenxixian/imgurl.git 克隆项目的路径),再执行:
+
+```
+./setup.sh
+```
+
+
+
 

+ 4 - 0
build.sh

@@ -0,0 +1,4 @@
+git clone https://github.com/helloxz/imgurl.git
+cd imgurl
+docker-compose up -d
+docker save -o  helloxz-imgurl.tar helloxz/imgurl:2.0

+ 52 - 0
default.conf

@@ -0,0 +1,52 @@
+server {
+    listen	 80;
+    server_name  localhost;
+
+    #charset koi8-r;
+    #access_log  /var/log/nginx/host.access.log  main;
+
+    location / {
+        root   /usr/share/nginx/html;
+index index.php index.html index.htm ;
+try_files $uri $uri/ /index.php?$query_string;
+    }
+
+location ~* \.(db3|json)$ {
+  deny all;
+}
+location ~* ^/(temp|upload|imgs|data|application|static|system)/.*.(php|php5)$ {
+    return 403;
+}
+
+    #error_page  404              /404.html;
+
+    # redirect server error pages to the static page /50x.html
+    #
+    error_page   500 502 503 504  /50x.html;
+    location = /50x.html {
+        root   /usr/share/nginx/html;
+    }
+
+    # proxy the PHP scripts to Apache listening on 127.0.0.1:80
+    #
+    #location ~ \.php$ {
+    #    proxy_pass   http://127.0.0.1;
+    #}
+
+    # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
+    #
+    location ~ \.php$ {
+        root           /usr/share/nginx/html;
+        fastcgi_pass   127.0.0.1:9000;
+        fastcgi_index  index.php;
+        fastcgi_param  SCRIPT_FILENAME  /usr/share/nginx/html$fastcgi_script_name;
+        include        fastcgi_params;
+    }
+
+    # deny access to .htaccess files, if Apache's document root
+    # concurs with nginx's one
+    #
+    #location ~ /\.ht {
+    #    deny  all;
+    #}
+}

+ 8 - 0
setup.sh

@@ -0,0 +1,8 @@
+docker load -i helloxz-imgurl.tar
+git clone https://github.com/helloxz/imgurl.git
+cd imgurl
+chmod 777 data
+chmod 777 imgs
+sed -i 's/build: ./# build: ./g'  docker-compose.yml
+sed -i 's/8080:80/80:80/g'  docker-compose.yml
+docker-compose up -d

+ 8 - 0
www.sh

@@ -0,0 +1,8 @@
+nginx
+php-fpm
+
+a=`lsof -i:88 | wc -l`
+while  [ $a -eq 0 ];
+do
+      a=`lsof -i:88 | wc -l`
+done