Created
September 23, 2019 12:13
-
-
Save RobDWaller/ce1e58df5c5afeeab8ec46fc9b96d46d to your computer and use it in GitHub Desktop.
Create PHP Docker Environment with Composer and XDebug
This file contains 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
# docker-compose.yml | |
version: "3" | |
services: | |
php: | |
build: | |
context: . | |
dockerfile: Dockerfile | |
volumes: | |
- .:/var/www/html | |
working_dir: /var/www/html | |
tty: true | |
ports: | |
- "8080:80" | |
# Dockerfile | |
FROM php:7.3 | |
RUN apt-get update && apt-get install -y git zip unzip \ | |
&& php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" \ | |
&& php composer-setup.php --install-dir=/usr/local/bin --filename=composer \ | |
&& rm composer-setup.php \ | |
&& docker-php-ext-install bcmath exif | |
RUN pecl install xdebug \ | |
&& docker-php-ext-enable xdebug |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment