dever 6 年之前
父节点
当前提交
37dc93b801

+ 2 - 2
container/conf/web/nginx/conf.d/site.conf

@@ -40,8 +40,8 @@ server {
         # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
 
         # With php-cgi alone:
-        #fastcgi_pass web-php7:9000;
-        fastcgi_pass web-php5:9000;
+        fastcgi_pass web-php7:9000;
+        #fastcgi_pass web-php5:9000;
         # With php-fpm:
         #fastcgi_pass unix:/var/run/php7-fpm.sock;
         fastcgi_index index.php;

+ 5 - 5
src/docker/build/office/convert/Dockerfile

@@ -6,7 +6,7 @@ ENV DEMETER_HOME=/usr/local/convert
 ENV DEMETER_CONF=env
 ENV PATH=$PATH:$DEMETER_HOME
 
-RUN apk add --no-cache --update git curl gcc g++ python-dev py-pip openssl-dev libffi-dev imagemagick imagemagick-dev && \
+RUN apk add --no-cache --update git curl nginx gcc g++ python-dev py-pip make cmake openssl-dev libffi-dev imagemagick imagemagick-dev && \
 	pip install --upgrade pip && \
 	pip install gevent==1.2 && \
 	pip install redis && \
@@ -17,9 +17,9 @@ RUN apk add --no-cache --update git curl gcc g++ python-dev py-pip openssl-dev l
 	tar -zxvf poppler-data-0.4.9.tar.gz && \
 	cd poppler-data-0.4.9 && \
 	make install datadir=/usr/share && \
-	#chmod -R +x $DEMETER_HOME/*.py && \
-	apk del curl gcc g++ python-dev
+	apk del curl make cmake gcc g++ python-dev
 
-EXPOSE 8087 8088
+EXPOSE 8087 8088 80 443
 
-COPY convert.sh /entrypoint/convert.sh
+COPY convert.sh /entrypoint/convert.sh
+COPY convert.conf /etc/nginx/conf.d/convert.conf

+ 16 - 0
src/docker/build/office/convert/convert.conf

@@ -0,0 +1,16 @@
+server
+{
+    server_name localhost;
+    listen 80 default_server;
+    root /www/convert/;
+
+	location ^~ /static/ {
+        try_files $uri $uri/ =404;
+    }
+    location ^~ /share/ {
+        try_files $uri $uri/ =404;
+    }
+    location / {
+        proxy_pass http://0.0.0.0:8088/;
+    }
+}

+ 4 - 0
src/docker/build/office/convert/convert.sh

@@ -3,11 +3,13 @@ set -e
 
 start_convert()
 {
+    mysqladmin -hoffice_mysql -uroot -p create office_convert
     cd $DEMETER_HOME
     git reset --hard FETCH_HEAD
     git pull
     chmod -R +x $DEMETER_HOME/*.py
     install.py
+    process_start nginx
     process_start admin.py
     process_start front.py
     process_start cron.py
@@ -15,6 +17,7 @@ start_convert()
 
 stop_convert()
 {
+    process_stop nginx
     process_stop admin.py
     process_stop front.py
     process_stop cron.py
@@ -22,6 +25,7 @@ stop_convert()
 
 monit_convert()
 {
+    process_monit nginx
 	process_monit admin.py
     process_monit front.py
     process_monit cron.py

+ 11 - 6
src/docker/conf/office.conf

@@ -1,11 +1,16 @@
 [base]
 path = {base}
 
-[convert]
-port = 8087:8087,8088:8088
-volumes = /www/wwwroot/7wap.cn/convert/runtime/files:/usr/local/convert/runtime/files
-command = sh
+[mysql]
+image = mariadb
+volumes = {container}conf/db/mariadb:/etc/mysql,/data/convert_mysql/{name}/data:/var/lib/mysql
+environment = MYSQL_ROOT_PASSWORD=123456
 
 [redis]
-port = 6379:6379
-volumes = {container}conf/db/redis/redis.conf:/etc/redis.conf
+#port = 6379:6379
+volumes = {container}conf/db/redis/redis.conf:/etc/redis.conf
+
+[convert]
+port = 8087:8087,8088:8088
+volumes = {container}web:/www,{container}web/convert/static:/usr/local/convert/front/static,{container}web/convert/files:/usr/local/convert/runtime/upload
+command = sh

+ 3 - 3
src/docker/conf/web.conf

@@ -1,10 +1,10 @@
 [base]
 path = {base}
-default = mysql,php7,nginx
+default = mariadb,php7,nginx
 
 [mysql]
 #port = 3309:3306
-volumes = {container}conf/db/mysql:/etc/mysql,/mysql/{name}/data:/var/lib/mysql
+volumes = {container}conf/db/mysql:/etc/mysql,/data/mysql/{name}/data:/var/lib/mysql
 environment = MYSQL_ROOT_PASSWORD=123456
 alias = mysql
 
@@ -12,7 +12,7 @@ alias = mysql
 #使用mariadb来代替mysql
 image = mariadb
 #port = 3310:3306
-volumes = {container}conf/db/mariadb:/etc/mysql,/mysql/{name}/data:/var/lib/mysql
+volumes = {container}conf/db/mariadb:/etc/mysql,/data/mysql/{name}/data:/var/lib/mysql
 environment = MYSQL_ROOT_PASSWORD=123456
 alias = mysql
 

+ 2 - 2
src/tool/cluster.py

@@ -274,8 +274,8 @@ class Cluster_Action(Docker_Action):
 	def join(self, **param):
 		(ip, ckey) = self.setting()
 		value = self.get(ckey, ip, False)
-		config = value.split(':')
-		print config
+		#config = value.split(':')
+		print value
 
 		'''
 		Core.popen('dm pull consul')