Skip to content

Instantly share code, notes, and snippets.

@FabrizioCafolla
Last active April 4, 2023 15:26
Show Gist options
  • Save FabrizioCafolla/247d09d204af20493186a27b10b0d712 to your computer and use it in GitHub Desktop.
Save FabrizioCafolla/247d09d204af20493186a27b10b0d712 to your computer and use it in GitHub Desktop.
PHP 7.4 alpine docker container - with dependencies and gRPC extension
FROM php:7.4-fpm-alpine
LABEL mantainer="developer@fabriziocafolla.com"
LABEL description="PHP alpine - docker container with dependencies and gRPC extension "
# # #
# Install build dependencies
# # #
ENV build_deps \
autoconf \
zlib-dev
RUN apk upgrade --update-cache --available && apk update && \
apk add --virtual .build-dependencies $build_deps
# # #
# Install persistent dependencies
# # #
ENV persistent_deps \
g++ \
gcc \
linux-headers \
make \
zlib
RUN apk add --update --virtual .persistent-dependencies $persistent_deps
# # #
# Install grpc extension
# # #
RUN apk add grpc \
&& pecl install grpc
# # #
# remove build deps
# # #
RUN apk del -f .build-dependencies
USER www-data
WORKDIR /var/www
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment