Giter Site home page Giter Site logo

docker-php-dev's Introduction

docker-php-dev

php simple develop environment.

# docker run --rm trylife/phpdev:7.1-fpm php -v

PHP 7.1.33 (cli) (built: Nov 22 2019 18:34:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2018 Zend Technologies
    with Xdebug v2.9.8, Copyright (c) 2002-2020, by Derick Rethans

参考 docker-compose.yml

version: '2.1'

services:
  php71:
    image: trylife/phpdev:7.1-fpm
    command:  php -S 0.0.0.0:80 -t www
    environment:
      - docker=true
      - TZ=Asia/Shanghai
    ports:
      - 9090:80
    volumes:
      - ./{your project}:/var/www
      - ./{your project}/logs:/var/www/logs
  adminer:
    environment:
      - TZ=Asia/Shanghai
    ports:
      - 9092:8080
    image: adminer
    restart: always
  redis:
    image: docker.io/redis:6-alpine
    restart: always
    environment:
      - TZ=Asia/Shanghai
    ports:
      - 9093:6379
    logging:
      driver: "json-file"
      options:
        max-size: "50m"
  phpRedisAdmin:
    image: erikdubbelboer/phpredisadmin:latest
    restart: always
    environment:
      - TZ=Asia/Shanghai
      - REDIS_1_HOST=redis
    ports:
      - 9094:80
    logging:
      driver: "json-file"
      options:
        max-size: "50m"

快捷脚本

可以复制dk.sh到项目, phpunit需要依赖vendor需要修改下grep关键词

# ./dk.sh composer
# ./dk.sh phpunit
#!/usr/bin/env zsh

if [ $# -lt 1 ]; then
  echo "operation can not be empty!"
  exit
fi

if [ "$1" = "phpunit" ]; then
  project_name=${PWD##*/}
  docker exec `docker ps | grep -i $project_name | grep php71 | awk '{print $1}'` $*
else
  docker run --rm --interactive --tty --volume $PWD:/var/www trylife/phpdev:7.1-fpm $*
fi

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.