Add PHP7.2, 8.0 containers

This commit is contained in:
Florian Brinker 2021-05-09 00:49:47 +02:00
parent e9c3deceef
commit 3982e7aa95
3 changed files with 54 additions and 0 deletions

View File

@ -1,11 +1,29 @@
version: "3.7"
services:
php7.2:
build: docker/php7.2
container_name: extension-check-7.2
volumes:
- .:/app:rw
tty: true
extra_hosts:
- "host.docker.internal:host-gateway"
php7.4:
build: docker/php7.4
container_name: extension-check-7.4
volumes:
- .:/app:rw
tty: true
extra_hosts:
- "host.docker.internal:host-gateway"
php8.0:
build: docker/php8.0
container_name: extension-check-8.0
volumes:
- .:/app:rw
tty: true
extra_hosts:
- "host.docker.internal:host-gateway"

18
docker/php7.2/Dockerfile Normal file
View File

@ -0,0 +1,18 @@
FROM php:7.2-alpine
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/
RUN install-php-extensions xdebug
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.log=/tmp/xdebug.log" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.discover_client_host=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.client_port=9000" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/xdebug.ini
WORKDIR /docker
# Workaround to keep container running
CMD ["tail", "-f", "/dev/null"]

18
docker/php8.0/Dockerfile Normal file
View File

@ -0,0 +1,18 @@
FROM php:8.0-alpine
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/bin/
RUN install-php-extensions xdebug
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.log=/tmp/xdebug.log" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.discover_client_host=1" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.client_port=9000" >> /usr/local/etc/php/conf.d/xdebug.ini \
&& echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/xdebug.ini
WORKDIR /docker
# Workaround to keep container running
CMD ["tail", "-f", "/dev/null"]