multi version php site

回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

multi version php site

文章 yehlu »

1.建立 busybox www_data 共用資料區
2.將 php 5.2 , php 5.6 , nginx 全連結到 www_data
3.配置 nginx 的 conf 讓他服務多網站

代碼: 選擇全部

	
docker run --name=www_root -v ~/Sites:/var/www/html -d busybox echo wwwroot

代碼: 選擇全部

www_data:
  image: busybox
  volumes:
  - ~/Sites:/var/www/html

hope_mysql:
  container_name: hope_mysql
  restart: always
  image: mariadb:latest
  environment:
    - MYSQL_ROOT_PASSWORD=secret
    - MYSQL_DATABASE=homestead
    - MYSQL_USER=homestead
    - MYSQL_PASSWORD=secret
  volumes:
    - ~/dockerdb/mysql:/var/lib/mysql/

php:
  container_name: php
  restart: always
  image: tommylau/php-5.2
  links:
    - hope_mysql:db
  environment:
    - DB_HOST=hope_mysql
  volumes_from:
     - www_data

php56:
  container_name: php56
  restart: always
  image: myphp:5.6-fpm
  links:
    - hope_mysql:db
  environment:
    - DB_HOST=hope_mysql
  volumes_from:
        - www_data

hope_nginx:
  container_name: hope_nginx
  restart: always
  image: local/nginx
  ports:
    - "80:80"
  links:
    - php:php
    - php56:php56
  volumes:
    - ~/Sites/docker-auto/conf.d:/etc/nginx/conf.d
  volumes_from:
    - www_data
nginx conf.d

代碼: 選擇全部

fastcgi_pass php56:9000;
fastcgi_pass php:9000;
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

Re: multi version php site

文章 yehlu »

Possible values for ext-name:
bcmath bz2 calendar ctype curl dba dom enchant exif fileinfo filter ftp gd gettext gmp hash iconv imap interbase intl json ldap mbstring mcrypt mysqli oci8 odbc opcache pcntl pdo pdo_dblib pdo_firebird pdo_mysql pdo_oci pdo_odbc pdo_pgsql pdo_sqlite pgsql phar posix pspell readline recode reflection session shmop simplexml snmp soap sockets spl standard sysvmsg sysvsem sysvshm tidy tokenizer wddx xml xmlreader xmlrpc xmlwriter xsl zip
The command '/bin/sh -c docker-php-ext-install -j$(npro
回覆文章

回到「Docker」