fish 1 year ago
parent
commit
935e919265
2 changed files with 115 additions and 38 deletions
  1. 57 38
      deploy/docker-compose.debug.yml
  2. 58 0
      deploy/nginx/vhost.conf

+ 57 - 38
deploy/docker-compose.debug.yml

@@ -1,21 +1,41 @@
 version: '3.4'
 version: '3.4'
 
 
 services:
 services:
-  php-server:
-    image: jianboy/syoqi:latest
-    build:
-      context: .
-      dockerfile: ./Dockerfile
-    command: [ "sh", "-c", "php -S " ]
-    ports:
-      - 8080:8080
-    volumes:
-      - .:/var/www/html
-    networks:
-      - default
-    depends_on:
-      - mysql
-      # - redis
+  # php-server:
+  #   image: jianboy/syoqi:latest
+  #   build:
+  #     context: .
+  #     dockerfile: ./Dockerfile
+  #   command: [ "sh", "-c", "php -S " ]
+  #   ports:
+  #     - 8080:8080
+  #   volumes:
+  #     - .:/var/www/html
+  #   networks:
+  #     - default
+  #   depends_on:
+  #     - mysql
+  #     # - redis
+
+  # nginx:
+  #   container_name: survey-nginx
+  #   image: nginx:alpine
+  #   restart: always
+  #   ports:
+  #     - 8011:80
+  #   # depends_on:
+  #   #   - phpfpm
+  #   environment:
+  #     - TZ=Asia/Shanghai
+  #   working_dir: /var/www
+  #   # volumes_from:
+  #   #   - phpfpm
+  #   volumes:
+  #     - ./nginx/vhost.conf:/etc/nginx/conf.d/default.conf
+  #     - ./nginx/log:/etc/nginx/log
+  #   networks:
+  #     - survey_net:
+  #       ipv4_address: 192.168.10.80
 
 
   mysql:
   mysql:
     image: mysql:5.7
     image: mysql:5.7
@@ -26,29 +46,28 @@ services:
       MYSQL_PASSWORD: root
       MYSQL_PASSWORD: root
     ports:
     ports:
       - 3306:3306
       - 3306:3306
-    volumes:
-      - mysql:/var/lib/mysql
-    networks:
-      - default
+    # volumes:
+    #   - mysql:/var/lib/mysql
+    # networks:
+    #   - survey_net
 
 
-  redis:
-    image: redis:latest
-    ports:
-      - 6379:6379
-    volumes:
-      - redis:/data
-    networks:
-      - default
+  # redis:
+  #   image: redis:latest
+  #   ports:
+  #     - 6379:6379
+  #   volumes:
+  #     - redis:/data
+  #   networks:
+  #     - survey_net
 
 
-networks:
-  default:
-    external:
-      name: syoqi
+# networks:
+#   survey_net:
+#     driver: bridge
 
 
-volumes:
-  mysql:
-    external:
-      name: mysql
-  redis:
-    external:
-      name: redis
+# volumes:
+#   mysql:
+#     external:
+#       name: mysql
+  # redis:
+  #   external:
+  #     name: redis

+ 58 - 0
deploy/nginx/vhost.conf

@@ -0,0 +1,58 @@
+server {
+    listen 80;
+    index index.php index.html;
+    server_name bz.crmeb.com;
+
+    root /var/www/public;
+
+
+    location / {
+        # try_files $uri /index.php$is_args$args;
+        if (!-e $request_filename){
+            rewrite  ^(.*)$  /index.php?s=$1  last;   break;
+        }
+    }
+
+    location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
+    {
+        expires      30d;
+        error_log off;
+        access_log /dev/null;
+    }
+    
+    location ~ .*\.(js|css)?$
+    {
+        expires      12h;
+        error_log off;
+        access_log /dev/null; 
+    }
+    location /notice {
+        proxy_pass http://192.168.10.90:20002;  
+        proxy_http_version 1.1;
+        proxy_set_header Upgrade $http_upgrade;
+        proxy_set_header Connection "upgrade";
+        proxy_set_header X-real-ip $remote_addr;
+        proxy_set_header X-Forwarded-For $remote_addr;
+    }
+    location /msg {
+        proxy_pass http://192.168.10.90:20003/;  
+        proxy_http_version 1.1;
+        proxy_set_header Upgrade $http_upgrade;
+        proxy_set_header Connection "upgrade";
+        proxy_set_header X-real-ip $remote_addr;
+        proxy_set_header X-Forwarded-For $remote_addr;
+    }
+    
+   
+
+    location ~ \.php$ {
+        fastcgi_split_path_info ^(.+\.php)(/.+)$;
+        fastcgi_pass phpfpm:9000;
+        fastcgi_index index.php;
+        include fastcgi_params;
+        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
+        fastcgi_param PATH_INFO $fastcgi_path_info;
+    }
+    
+   
+}