Coder Social home page Coder Social logo

php-dockerfile's Introduction

cqcqs/php-dockerfile

PHP官方源镜像支持的扩展有限,自己基于原官方扩展之上,再做了一层包装,包含 composerPDOGDredismongoswooleImagick 等扩展

Tags

镜像版本 Git分支 PHP版本 镜像大小
8.2 8.2 | main 8.2 390.838 MB
8.2-alpine 8.2-alpine 8.2 193.088 MB
7.4 7.4 7.4 380.639 MB
7.4-alpine 7.4-alpine 7.4 171.866 MB

构建镜像

本地构建

docker build -t php-fpm:8.2 .

阿里源(推荐)

# 8.2
docker pull registry.cn-hangzhou.aliyuncs.com/cqcqs/php-fpm:8.2

# 7.4
docker pull registry.cn-hangzhou.aliyuncs.com/cqcqs/php-fpm:7.4

# 7.4 历史版本,未安装Imagick扩展
docker pull registry.cn-hangzhou.aliyuncs.com/cqcqs/php74-fpm

官方源

# php8.2
docker pull mhzuhe/php-fpm:8.2

# php7.4
docker pull mhzuhe/php-fpm:7.4

使用

结合 nginx ,用 docker-compose 搭建一个 php web 项目

version: '1.0'
services:
  php8:
    image: registry.cn-hangzhou.aliyuncs.com/cqcqs/php-fpm:8.2
    container_name: php8
    restart: always
    ports:
      - 9000:9000
    volumes:
      - /data/www:/var/www/html
    networks:
      net:
        ipv4_address: 172.18.0.11

  nginx:
    image: nginx
    container_name: nginx
    restart: always
    ports:
      - 80:80
    volumes:
      - /data/www:/usr/share/nginx/html
      - /usr/local/nginx/conf.d:/etc/nginx/conf.d
    working_dir: /usr/share/nginx/html
    links:
      - php7
    networks:
      net:
        ipv4_address: 172.18.0.12

networks:
  net: 
    driver: bridge
    ipam:
      driver: default
      config:
        - subnet: 172.18.0.0/24

php-dockerfile's People

Contributors

cqcqs avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  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.