Skip to content

Commit

Permalink
dynamic php versioning
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Heramis <[email protected]>
  • Loading branch information
Mark Heramis committed Feb 20, 2024
1 parent a7744fc commit 85ce961
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ ARG WWWGROUP=1000
ARG WWWUSER=1000

ARG NODE_VERSION=21
ARG PHP_VERSION=$PHP_VERSION

WORKDIR /var/www/html

Expand All @@ -26,28 +27,28 @@ RUN echo "deb [signed-by=/usr/share/keyrings/ppa_ondrej_php.gpg] https://ppa.lau

RUN apt-get update
RUN apt-get install -y \
php8.2-cli \
php8.2-dev \
php8.2-pgsql \
php8.2-sqlite3 \
php8.2-gd \
php8.2-curl \
php8.2-imap \
php8.2-mysql \
php8.2-mbstring \
php8.2-xml \
php8.2-zip \
php8.2-bcmath \
php8.2-soap \
php8.2-intl \
php8.2-readline \
php8.2-ldap \
php8.2-msgpack \
php8.2-igbinary \
php8.2-redis \
php8.2-memcached \
php8.2-pcov \
php8.2-xdebug
php$PHP_VERSION-cli \
php$PHP_VERSION-dev \
php$PHP_VERSION-pgsql \
php$PHP_VERSION-sqlite3 \
php$PHP_VERSION-gd \
php$PHP_VERSION-curl \
php$PHP_VERSION-imap \
php$PHP_VERSION-mysql \
php$PHP_VERSION-mbstring \
php$PHP_VERSION-xml \
php$PHP_VERSION-zip \
php$PHP_VERSION-bcmath \
php$PHP_VERSION-soap \
php$PHP_VERSION-intl \
php$PHP_VERSION-readline \
php$PHP_VERSION-ldap \
php$PHP_VERSION-msgpack \
php$PHP_VERSION-igbinary \
php$PHP_VERSION-redis \
php$PHP_VERSION-memcached \
php$PHP_VERSION-pcov \
php$PHP_VERSION-xdebug
RUN php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/usr/bin/ --filename=composer

RUN curl -sLS https://deb.nodesource.com/setup_$NODE_VERSION.x | bash -
Expand All @@ -62,13 +63,13 @@ RUN apt-get -y autoremove \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.2
RUN setcap "cap_net_bind_service=+ep" /usr/bin/php$PHP_VERSION

RUN groupadd --force -g $WWWGROUP sail
RUN useradd -ms /bin/bash --no-user-group -g $WWWGROUP -u 1337 sail

COPY ./php/php.ini /etc/php/8.1/cli/conf.d/99-sail.ini
COPY ./php/xdebug.ini /etc/php/8.1/mods-available/xdebug.ini
COPY ./php/php.ini /etc/php/$PHP_VERSION/cli/conf.d/99-sail.ini
COPY ./php/xdebug.ini /etc/php/$PHP_VERSION/mods-available/xdebug.ini
COPY ./supervisor/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY ./start-container /usr/local/bin/start-container
RUN chmod +x /usr/local/bin/start-container
Expand Down

0 comments on commit 85ce961

Please sign in to comment.