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

PHP Builder #1

Open
deiucanta opened this issue May 11, 2022 · 1 comment
Open

PHP Builder #1

deiucanta opened this issue May 11, 2022 · 1 comment

Comments

@deiucanta
Copy link
Member

We can get inspiration from https://phpdocker.io/

@Supernova3339
Copy link

`FROM php:7.4-apache
COPY . /var/www/html
RUN docker-php-ext-install pdo_mysql

RUN apt-get update

1. development packages

RUN apt-get install -y
git
zip
curl
sudo
nano
unzip
libicu-dev
libbz2-dev
libpng-dev
libjpeg-dev
libmcrypt-dev
libreadline-dev
libfreetype6-dev
g++

2. apache configs + document root

ENV APACHE_DOCUMENT_ROOT=/var/www/html
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/.conf
RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/
.conf

3. mod_rewrite for URL rewrite and mod_headers for .htaccess extra headers like Access-Control-Allow-Origin-

RUN a2enmod rewrite headers

4. start with base php config, then add extensions

RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

RUN docker-php-ext-configure gd && docker-php-ext-install gd

RUN docker-php-ext-install
bz2
intl
iconv
bcmath
opcache
calendar
exif
pdo_mysql

5. composer

COPY --from=composer:latest /usr/bin/composer /usr/bin/composer

CMD ["apache2ctl", "-D", "FOREGROUND"]`

this is my docker image for PHP, few weeks and I will make the builder for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants