You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to offer assistance to those who intend to use @gkralik's excellent package for PHP 8.2 with Docker. This is not a problem but rather a helpful suggestion, as the package also includes Xdebug for debugging purposes.
So here is a working Dockerfile
FROM php:8.2-fpm
# Arguments defined in docker-compose.yml
ARG user
ARG uid
ENV LD_LIBRARY_PATH=/usr/sap/nwrfcsdk/lib
ENV COMPOSER_ALLOW_SUPERUSER=1
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libxml2-dev \
&& docker-php-ext-configure gd --with-freetype --with-jpeg \
&& docker-php-ext-install -j$(nproc) gd
RUN apt-get install -y libzip-dev \
&& docker-php-ext-install zip
RUN apt-get update && \
apt-get install -y libxml2-dev && \
docker-php-ext-install soap
# Install PHP extensions
RUN apt-get update && \
docker-php-ext-install pdo_mysql exif pcntl bcmath opcache
RUN apt-get install git -y
RUN cd /usr \
&& mkdir sap \
&& mkdir nwrfcsdk
RUN cd /usr \
&& git clone https://github.com/szabizs/sapnwrfc_php_7_4_linux.git \
&& ls -1 \
&& mv /usr/sapnwrfc_php_7_4_linux /usr/sap/nwrfcsdk
RUN git clone https://github.com/gkralik/php7-sapnwrfc.git
RUN cd php7-sapnwrfc \
&& phpize \
&& ./configure \
&& make \
&& make install
RUN cd /usr/local/etc/php/conf.d \
&& touch ext-sapnwrfc.ini \
&& echo "extension=sapnwrfc.so" > ext-sapnwrfc.ini
# Install imagick library
RUN apt-get update && apt-get install -y \
libmagickwand-dev --no-install-recommends \
&& pecl install imagick \
&& docker-php-ext-enable imagick
RUN pecl install xdebug-3.2.0 \
&& docker-php-ext-enable xdebug \
&& echo "xdebug.mode=debug" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_port=9003" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.start_with_request=yes" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.discover_client_host=0" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
&& echo "xdebug.client_host=host.docker.internal" >> /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
RUN apt-get update && apt-get install -y \
software-properties-common \
npm
RUN npm install npm@7 -g && \
npm install n -g && \
n latest
RUN npm install cross-env && \
npm install -D tailwindcss postcss autoprefixer
RUN curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer
# Clear cache
RUN apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=composer:latest /usr/bin/composer /usr/bin/composer
# Create system user to run Composer and Artisan Commands
RUN mkdir -p /home/$user/.composer && \
chown -R $user:$user /home/$user
# Expose port 9000 and start php-fpm server (for FastCGI Process Manager)
EXPOSE 4206
WORKDIR /var/wwww
COPY . .
#RUN composer install
USER $user
The text was updated successfully, but these errors were encountered:
Hello developers,
I would like to offer assistance to those who intend to use @gkralik's excellent package for PHP 8.2 with Docker. This is not a problem but rather a helpful suggestion, as the package also includes Xdebug for debugging purposes.
So here is a working Dockerfile
The text was updated successfully, but these errors were encountered: