链接子域到Laravel应用程序使用Docker / Docker-compose在centos 6 vps上

我使用Docker,docker-compose和laravel创build了一个应用程序。 我想要这个应用程序在我的子域do.ine.mycompany.com。 我其实已经完成了我的子域和dns文件寿的Apacheconfiguration。

其实我有我的主域名mycompany.com在我的vps在centos 6使用Apache。

我想知道如果我可以安装我的应用程序使用docker和dockerized nginx在相同的VPS。 如果它不会与我的networking服务器有问题。

以及如何使我的子域点在我的ngnix容器?`

这是我的docker-compose.yml

version: "3.1" services: redis: image: redis:alpine container_name: mobilezsv-redis mysql: image: mysql:5.7 container_name: mobilezsv-mysql working_dir: /application volumes: - ./src:/application environment: - MYSQL_ROOT_PASSWORD= - MYSQL_DATABASE= - MYSQL_USER= - MYSQL_PASSWORD= ports: - "8890:3306" webserver: image: nginx:alpine container_name: mobilezsv-webserver working_dir: /application volumes: - ./src:/application - ./phpdocker/nginx/nginx.conf:/etc/nginx/conf.d/default.conf ports: - "8888:80" php-fpm: build: phpdocker/php-fpm container_name: mobilezsv-php-fpm working_dir: /application volumes: - ./src:/application - ./phpdocker/php-fpm/php-inioverrides.ini:/etc/php/7.0/fpm/conf.d/99-overrides.ini 

这是我的nginx.conf文件

 server { listen 80 default; client_max_body_size 208M; access_log /var/log/nginx/application.access.log; root /application/public; index index.php; if (!-e $request_filename) { rewrite ^.*$ /index.php last; } location ~ \.php$ { fastcgi_pass php-fpm:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PHP_VALUE "error_log=/var/log/nginx/application_php_errors.log"; fastcgi_buffers 16 16k; fastcgi_buffer_size 32k; include fastcgi_params; } } 

这是我们的应用程序的.env。

 APP_ENV=local APP_DEBUG=true APP_KEY=base64:UngfwiiA2twNJpyQmiugZyk8nLQjX8aZIxmueYncqqs= APP_URL=http://localhost DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=Mobile DB_USERNAME=admin DB_PASSWORD=admin CACHE_DRIVER=file SESSION_DRIVER=file QUEUE_DRIVER=sync REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 MAIL_DRIVER=smtp MAIL_HOST=mailtrap.io MAIL_PORT=2525 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null 

感谢您的帮助。