Last active
August 25, 2021 10:20
-
-
Save Treast/cfebc89ce361f988fd45fe91d8d618b0 to your computer and use it in GitHub Desktop.
Docker WordPress PHP7.4 / Apache / MySQL
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3" | |
services: | |
www: | |
build: . | |
ports: | |
- 8000:80 | |
volumes: | |
- ./:/var/www/html/ | |
links: | |
- db | |
networks: | |
- default | |
db: | |
image: mysql | |
ports: | |
- "${DB_PORT}:3306" | |
environment: | |
MYSQL_DATABASE: "${DB_NAME}" | |
MYSQL_USER: "${DB_USER}" | |
MYSQL_PASSWORD: "${DB_PASSWORD}" | |
MYSQL_ROOT_PASSWORD: "${DB_PASSWORD}" | |
volumes: | |
- ./_docker/dumps:/docker-entrypoint-initdb.d | |
- persistent:/var/lib/mysql | |
networks: | |
- default | |
phpmyadmin: | |
image: phpmyadmin/phpmyadmin | |
links: | |
- db:db | |
ports: | |
- 8001:80 | |
environment: | |
MYSQL_USER: "${DB_USER}" | |
MYSQL_PASSWORD: "${DB_PASSWORD}" | |
MYSQL_ROOT_PASSWORD: "${DB_PASSWORD}" | |
redis: | |
image: redis:6-alpine | |
ports: | |
- 6379:6379 | |
networks: | |
- default | |
volumes: | |
persistent: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:7.4.21-apache | |
ENV APACHE_DOCUMENT_ROOT /var/www/html/web | |
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 | |
RUN sed -i '/<Directory \${APACHE_DOCUMENT_ROOT}>/,/<\/Directory>/ s/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf | |
RUN a2enmod rewrite | |
RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli | |
RUN apt-get update && apt-get install -y \ | |
libfreetype6-dev \ | |
libjpeg62-turbo-dev \ | |
libpng-dev \ | |
libmcrypt-dev \ | |
zlib1g-dev \ | |
libxml2-dev \ | |
libzip-dev \ | |
libonig-dev \ | |
graphviz \ | |
libmagickwand-dev --no-install-recommends | |
RUN pecl install imagick \ | |
&& docker-php-ext-install -j$(nproc) iconv \ | |
&& docker-php-ext-configure gd --with-freetype --with-jpeg \ | |
&& docker-php-ext-install -j$(nproc) gd \ | |
&& docker-php-ext-install zip \ | |
&& docker-php-ext-enable imagick \ | |
&& docker-php-ext-configure intl \ | |
&& docker-php-ext-install intl \ | |
&& pecl install redis && docker-php-ext-enable redis |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment