GithubHelp home page GithubHelp logo

izhiqiang / docker-php Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 11.68 MB

docker php Dockerfile

Home Page: https://hub.docker.com/r/zhiqiangwang/php/tags

License: Apache License 2.0

C 47.31% C++ 34.98% PHP 16.23% Shell 1.49%

docker-php's Introduction

构建

docker build -f Dockerfile.7.4-fpm -t zhiqiangwang/php:7.4-fpm  .
docker build -f Dockerfile.7.4-cli -t zhiqiangwang/php:7.4-cli  .

docker build -f Dockerfile.7.4-fpm-wxwork-finance -t zhiqiangwang/php:7.4-fpm-wxwork-finance .
docker build -f Dockerfile.7.4-cli-wxwork-finance -t zhiqiangwang/php:7.4-cli-wxwork-finance .

docker build -f Dockerfile.8.1-fpm -t zhiqiangwang/php:8.1-fpm  .
docker build -f Dockerfile.8.1-cli -t zhiqiangwang/php:8.1-cli  .

docker build -f Dockerfile.8.2-fpm -t zhiqiangwang/php:8.2-fpm  .
docker build -f Dockerfile.8.2-cli -t zhiqiangwang/php:8.2-cli  .


docker build --build-arg="IMAGE_TAG=7.4-fpm" -f Dockerfile.nginx -t zhiqiangwang/php:7.4-fpm-nginx  .


docker build --build-arg="IMAGE_TAG=7.4-fpm" -f Dockerfile.composer -t zhiqiangwang/php:7.4-fpm-composer  .

docker build -f Dockerfile.phpmyadmin -t zhiqiangwang/php:phpmyadmin .

docker build -f Dockerfile.ondrej -t zhiqiangwang/php:ondrej .

启动容器

docker run --name myphp -p 9000:9000 -v /data/wwwroot/laravel/:/var/www/html -d zhiqiangwang/php:7.4-fpm 

docker run --name myphp -p 8080:80 -d zhiqiangwang/php:7.4-fpm-nginx

常见配置目录

  • /etc/nginx
  • /usr/local/etc
  • /etc/supervisor
  • /var/spool/cron/crontabs

常见命令

  • /etc/init.d/cron
echo * * * * * Command >> /var/spool/cron/crontabs/root
chmod 600 /var/spool/cron/crontabs/root
/etc/init.d/cron start
  • nginx -g "daemon off;"
  • php -i | grep php.ini
  • php-fpm --nodaemonize

将日志打印到docker运行控制

ln -sf /dev/stdout /usr/local/openresty/nginx/logs/access.log

启动nginx+php容器

thinkphp nginx config

server {
  listen 80 default_server;
  listen [::]:80 default_server;
  root /var/www/html/public;
  index index.php;
  server_name _;
  location / {
    if (!-e $request_filename){
    	rewrite  ^(.*)$  /index.php?s=$1  last;   break;
    }
  }
  location ~ \.php$ {
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_index index.php;
    fastcgi_param SCRIPT_FILENAME $DOCUMENT_ROOT$fastcgi_script_name;
    include fastcgi_params;
  }
}

启动容器

docker run --name myphp -p 8080:80 -v /data/thinkphp:/var/www/html -v /data/thinkphp/thinkphp.conf:/etc/nginx/sites-enabled/default  -d zhiqiangwang/php:7.4-fpm-nginx

docker-php's People

Contributors

izhiqiang avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.