Created
October 18, 2020 02:32
-
-
Save xuboso/f0b9b065f6c508b0616a1b1f00e79bad to your computer and use it in GitHub Desktop.
build php development environment use docker compose
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '2' | |
| services: | |
| web: | |
| image: nginx:latest | |
| ports: | |
| - "8080:80" | |
| volumes: | |
| - ./code:/code | |
| - ./site.conf:/etc/nginx/conf.d/default.conf | |
| networks: | |
| - code-network | |
| php: | |
| image: php:fpm | |
| volumes: | |
| - ./code:/code | |
| - ./php.ini:/usr/local/etc/php/php.ini | |
| networks: | |
| - code-network | |
| command: > | |
| bash -c "apt-get update -y && | |
| apt-get install -y libfreetype6-dev && | |
| apt-get install -y libjpeg62-turbo-dev && | |
| apt-get install -y libpng12-dev && | |
| docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ && | |
| docker-php-ext-install gd" | |
| composer: | |
| image: composer/composer:php7 | |
| restart: 'no' | |
| command: install | |
| working_dir: /code | |
| volumes: | |
| - ./code:/code | |
| networks: | |
| - code-network | |
| mysql: | |
| image: mysql:5.7 | |
| environment: | |
| - MYSQL_ROOT_PASSWORD=root | |
| - MYSQL_DATABASE=docker | |
| - MYSQL_USER=docker-container | |
| - MYSQL_PASSWORD=YqukX1!m!eBeP | |
| networks: | |
| - code-network | |
| redis: | |
| image: redis:5.0-alpine | |
| ports: | |
| - "16379:6379" | |
| networks: | |
| code-network: | |
| driver: bridge |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment