Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Use alpine image for php #13

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Dockerfile.php.dev
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
FROM php:7.4-fpm
FROM php:7.4-fpm-alpine

# opcache
RUN docker-php-ext-install opcache

# mysql PDO
RUN docker-php-ext-install pdo pdo_mysql

# xdebug
RUN pecl install xdebug
RUN docker-php-ext-enable xdebug
# Xdebug: https://stackoverflow.com/questions/46825502/how-do-i-install-xdebug-on-dockers-official-php-fpm-alpine-image
# PHPIZE_DEPS: autoconf dpkg-dev dpkg file g++ gcc libc-dev make pkgconf re2c
RUN apk add --no-cache --virtual .build-dependencies $PHPIZE_DEPS \
&& pecl install xdebug-3.1.5 \
&& docker-php-ext-enable xdebug \
&& docker-php-source delete \
&& apk del .build-dependencies
RUN { \
echo "[xdebug]"; \
echo "zend_extension=xdebug"; \
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile.php.prod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:7.4-fpm AS build
FROM php:7.4-fpm-alpine AS build
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN echo "I am running on $BUILDPLATFORM, building for $TARGETPLATFORM"
Expand All @@ -10,7 +10,7 @@ RUN chown -R www-data:www-data . \
&& find . -type d -exec chmod 750 {} \; \
&& find . -type f -exec chmod 640 {} \;

FROM php:7.4-fpm AS final
FROM php:7.4-fpm-alpine AS final

# opcache
RUN docker-php-ext-install opcache
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ docker-compose up --build
# phpmyadmin available at http://localhost:8080. Username: root, password: ascent. See ./config/ASP/config.php config file

# Fix php xdebug not reaching host IDE
iptables -A INPUT -i br+ -j ACCEPT
sudo iptables -A INPUT -i br+ -j ACCEPT

# Test routes
docker-compose -f docker-compose.test.yml up
Expand Down