Skip to content

Commit

Permalink
added Apache PHP 8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamdeew committed Oct 17, 2022
1 parent bfa14cb commit 9c4b2db
Show file tree
Hide file tree
Showing 13 changed files with 179 additions and 10 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,22 @@ jobs:
run: make st


- name: Build the stack Apache PHP-81 and hack with default.conf
run: cp mysql.env.example mysql.env && cp docker/nginx/config/templates/site.test.conf-apache-php-81 docker/nginx/config/default.conf && sed -i 's/server_name site.test/server_name _/g' docker/nginx/config/default.conf && cp docker/apache-php-81/config/templates/site.test.conf docker/apache-php-81/config/sites-enabled/default.conf && sed -i 's/ServerName site.test/ /g' docker/apache-php-81/config/sites-enabled/default.conf && cp templates/docker-compose-apache-php-81.yml docker-compose.yml && make upb
- name: Test Nginx localhost
run: docker run --network container:docker-compose-php_nginx_1 appropriate/curl -s --retry 1 --retry-connrefused http://super:demo@localhost/ | grep '8.1'
- name: Stop containers
run: make st


- name: Build the stack Apache PHP-74 and hack with default.conf
run: cp mysql.env.example mysql.env && cp docker/nginx/config/templates/site.test.conf-apache-php-74 docker/nginx/config/default.conf && sed -i 's/server_name site.test/server_name _/g' docker/nginx/config/default.conf && cp docker/apache-php-74/config/templates/site.test.conf docker/apache-php-74/config/sites-enabled/default.conf && sed -i 's/ServerName site.test/ /g' docker/apache-php-74/config/sites-enabled/default.conf && cp templates/docker-compose-apache-php-74.yml docker-compose.yml && make upb
- name: Test Nginx localhost
run: docker run --network container:docker-compose-php_nginx_1 appropriate/curl -s --retry 1 --retry-connrefused http://super:demo@localhost/ | grep '7.4'
- name: Stop containers
run: make st


- name: Build the stack Apache PHP-71 and hack with default.conf
run: cp mysql.env.example mysql.env && cp docker/nginx/config/templates/site.test.conf-apache-php-71 docker/nginx/config/default.conf && sed -i 's/server_name site.test/server_name _/g' docker/nginx/config/default.conf && cp docker/apache-php-71/config/templates/site.test.conf docker/apache-php-71/config/sites-enabled/default.conf && sed -i 's/ServerName site.test/ /g' docker/apache-php-71/config/sites-enabled/default.conf && cp templates/docker-compose-apache-php-71.yml docker-compose.yml && make upb
- name: Test Nginx localhost
Expand All @@ -104,11 +120,3 @@ jobs:
run: docker run --network container:docker-compose-php_nginx_1 appropriate/curl -s --retry 1 --retry-connrefused http://super:demo@localhost/ | grep '5.6'
- name: Stop containers
run: make st


- name: Build the stack Apache PHP-74 and hack with default.conf
run: cp mysql.env.example mysql.env && cp docker/nginx/config/templates/site.test.conf-apache-php-74 docker/nginx/config/default.conf && sed -i 's/server_name site.test/server_name _/g' docker/nginx/config/default.conf && cp docker/apache-php-74/config/templates/site.test.conf docker/apache-php-74/config/sites-enabled/default.conf && sed -i 's/ServerName site.test/ /g' docker/apache-php-74/config/sites-enabled/default.conf && cp templates/docker-compose-apache-php-74.yml docker-compose.yml && make upb
- name: Test Nginx localhost
run: docker run --network container:docker-compose-php_nginx_1 appropriate/curl -s --retry 1 --retry-connrefused http://super:demo@localhost/ | grep '7.4'
- name: Stop containers
run: make st
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Nginx + MariaDB + MailHog + PHP-7.1/7.2/7.3/7.4/8.0/8.1 FPM + Apache mod-php 5.6/7.1/7.4
## Nginx + MariaDB + MailHog + PHP-7.1/7.2/7.3/7.4/8.0/8.1 FPM + Apache mod-php 5.6/7.1/7.4/8.1

![](https://github.com/rhamdeew/docker-compose-php/workflows/Docker%20Image%20CI/badge.svg)

Expand Down
2 changes: 1 addition & 1 deletion README_ru.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Nginx + MariaDB + MailHog + PHP-7.1/7.2/7.3/7.4/8.0/8.1 FPM + Apache mod-php 5.6/7.1/7.4
## Nginx + MariaDB + MailHog + PHP-7.1/7.2/7.3/7.4/8.0/8.1 FPM + Apache mod-php 5.6/7.1/7.4/8.1

![](https://github.com/rhamdeew/docker-compose-php/workflows/Docker%20Image%20CI/badge.svg)

Expand Down
2 changes: 2 additions & 0 deletions docker/apache-php-81/build/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM rhamdeew/docker-apache-php-81
#RUN usermod -u 1050 www-data && groupmod -g 1050 www-data
1 change: 1 addition & 0 deletions docker/apache-php-81/composer/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deny from all
1 change: 1 addition & 0 deletions docker/apache-php-81/composer/cache/.htaccess
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deny from all
35 changes: 35 additions & 0 deletions docker/apache-php-81/config/apache2.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
DefaultRuntimeDir ${APACHE_RUN_DIR}
PidFile ${APACHE_PID_FILE}
Timeout 300
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 5
User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}
HostnameLookups Off
ErrorLog ${APACHE_LOG_DIR}/error.log
LogLevel error
IncludeOptional mods-enabled/*.load
IncludeOptional mods-enabled/*.conf
Include ports.conf

<Directory /srv/projects>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>

AccessFileName .htaccess

<FilesMatch "^\.ht">
Require all denied
</FilesMatch>

LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%h %l %u %t \"%r\" %>s %O" common
LogFormat "%{Referer}i -> %U" referer
LogFormat "%{User-agent}i" agent

IncludeOptional conf-enabled/*.conf
IncludeOptional sites-enabled/*.conf
4 changes: 4 additions & 0 deletions docker/apache-php-81/config/msmtprc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
account mailhog
host mailhog
port 1025
from [email protected]
14 changes: 14 additions & 0 deletions docker/apache-php-81/config/php.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
date.timezone = "Europe/Moscow"
post_max_size=100M
upload_max_filesize=100M
;display_errors = On
sendmail_path = "/usr/bin/msmtp -a mailhog -t"

;Bitrix
realpath_cache_size = 4096K
mbstring.func_overload = 2
mbstring.internal_encoding = utf-8
opcache.revalidate_freq = 0
max_input_vars = 10000
memory_limit = 512M

7 changes: 7 additions & 0 deletions docker/apache-php-81/config/sites-enabled/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /srv/projects/default

#ErrorLog /srv/logs/error.log
#CustomLog /srv/logs/access.log combined
</VirtualHost>
5 changes: 5 additions & 0 deletions docker/apache-php-81/config/templates/site.test.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName site.test
DocumentRoot /srv/projects/site.test
</VirtualHost>
27 changes: 27 additions & 0 deletions docker/nginx/config/templates/site.test.conf-apache-php-81
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
server {
listen 80;

#имя сервера:
server_name site.test;

# корневая директория
root /srv/projects/site.test;
include conf.d/includes/restrictions.inc;

satisfy any;
allow 192.168.1.0/24;
deny all;
auth_basic "Restricted";
auth_basic_user_file .htpasswd;

######################################
# Apache config
######################################
location / {
proxy_pass http://apache-php-81;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
include conf.d/includes/assets.inc;
}
65 changes: 65 additions & 0 deletions templates/docker-compose-apache-php-81.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
version: '3.4'
x-logging:
&default-logging
driver: "json-file"
options:
max-file: "5"
max-size: "20m"

services:

mailhog:
image: mailhog/mailhog
restart: unless-stopped
#ports:
# - '127.0.0.1:1025:1025'
logging: *default-logging

db:
image: mariadb
restart: unless-stopped
env_file:
- mysql.env
volumes:
# - ./docker/mariadb/config:/etc/mysql/conf.d:ro
- ./db/data:/var/lib/mysql
#ports:
# - '127.0.0.1:3306:3306'
logging: *default-logging

nginx:
build: ./docker/nginx/build
image: nginx
restart: unless-stopped
volumes:
- ./docker/nginx/.htpasswd:/etc/nginx/.htpasswd:ro
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf:ro
- ./docker/nginx/config:/etc/nginx/conf.d:ro
- ./projects:/srv/projects
- ./docker/nginx/acme-challenge:/usr/share/nginx/html:ro
# - ./docker/nginx/ssl:/etc/nginx/ssl:ro
ports:
- "80:80"
# -"443:443"
- "8025:8025"
- "8080:8080"
logging: *default-logging

adminer:
image: adminer
restart: unless-stopped

apache-php-81:
build: ./docker/apache-php-81/build
image: apache-php-81
restart: unless-stopped
env_file:
- mysql.env
volumes:
- ./docker/apache-php-81/config/msmtprc:/etc/msmtprc:ro
- ./docker/apache-php-81/config/php.ini:/usr/local/etc/php/conf.d/my.ini:ro
- ./docker/apache-php-81/config/apache2.conf:/etc/apache2/apache2.conf:ro
- ./docker/apache-php-81/config/sites-enabled:/etc/apache2/sites-enabled:ro
- ./docker/apache-php-81/composer/:/root/.composer/
- ./projects/:/srv/projects/
logging: *default-logging

0 comments on commit 9c4b2db

Please sign in to comment.