Skip to content

Commit 5e9ace8

Browse files
committed
Various updates
1 parent ea9669c commit 5e9ace8

File tree

33 files changed

+1089
-11
lines changed

33 files changed

+1089
-11
lines changed

app/docker-compose.yml

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
version: "3.5"
2+
3+
services:
4+
mysql:
5+
build:
6+
context: "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/images/mariadb"
7+
container_name: "mysql"
8+
environment:
9+
MYSQL_ROOT_PASSWORD: 'revanza' # TODO: Change this
10+
MYSQL_USER: 'root'
11+
MYSQL_PASS: 'revanza'
12+
networks:
13+
- "dev_network"
14+
ports:
15+
- "3306:3306"
16+
expose:
17+
# Opens port 3306 on the container
18+
- '3306'
19+
volumes:
20+
- "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/logs/mariadb:/var/log/mysql:delegated"
21+
- "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/resources/etc/mysql/conf.d/:/etc/mysql/conf.d/"
22+
- "/System/Volumes/Data/Users/Shared/www/mysql:/var/lib/mysql"
23+
httpd:
24+
build:
25+
context: "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/images/httpd"
26+
container_name: "httpd"
27+
depends_on:
28+
- "php-fpm"
29+
networks:
30+
- "dev_network"
31+
ports:
32+
- "9080:9080"
33+
- "9443:9443"
34+
volumes:
35+
- "shared:/shared:cached" # allow to use the php-fpm socket
36+
- "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/logs/httpd:/var/log/httpd:delegated"
37+
- "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/resources/certificates:/certificates:cached"
38+
- "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/resources/usr/local/apache2/conf.d:/usr/local/apache2/conf.d:cached"
39+
- "/System/Volumes/Data/Users/Shared/www/public_html:/var/www/html"
40+
41+
nginx:
42+
build:
43+
context: "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/images/nginx"
44+
# Transform the template into an actual file
45+
command: /bin/bash -c "envsubst < /etc/nginx/fastcgi.conf.tpl > /etc/nginx/fastcgi.conf && nginx -g 'daemon off;'"
46+
container_name: "nginx"
47+
depends_on:
48+
- "php-fpm"
49+
environment:
50+
- "DOLLAR=$$"
51+
# links:
52+
# - mysql
53+
networks:
54+
dev_network:
55+
aliases: # Allows dev.localhost to be resolved internally from php-fpm
56+
- "dev.localhost"
57+
ports:
58+
- "80:80"
59+
- "8080:8080"
60+
- "443:443"
61+
volumes:
62+
- "shared:/shared:cached" # allow to use the php-fpm socket
63+
- "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/logs/nginx:/var/log/nginx:delegated"
64+
- "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/resources/certificates:/certificates:cached"
65+
- "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/resources/etc/nginx/conf.d:/etc/nginx/conf.d:cached"
66+
- "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/resources/etc/nginx/sites-available:/etc/nginx/sites-available"
67+
- "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/resources/etc/nginx/sites-enabled:/etc/nginx/sites-enabled"
68+
- "nfsmount:/var/www/html"
69+
- "nfsmount2:/var/www/git"
70+
php-fpm:
71+
build:
72+
context: "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/images/php-fpm"
73+
container_name: "php-fpm"
74+
depends_on:
75+
- "mysql"
76+
environment: &php-env
77+
- "TEST_BASEURL"
78+
- "TEST_DB_HOST"
79+
- "TEST_DB_NAME"
80+
- "TEST_DB_USER"
81+
- "TEST_DB_PASSWORD"
82+
networks: &php-networks
83+
- "dev_network"
84+
volumes: &php-volumes
85+
- "shared:/shared:cached" # expose php-fpm socket
86+
- "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/logs/php-fpm:/var/log/php-fpm:delegated"
87+
- "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/resources/certificates:/usr/local/share/ca-certificates:cached" # Mount extra certificates
88+
- "nfsmount:/var/www/html"
89+
- "nfsmount2:/var/www/git"
90+
php-fpm-xdebug:
91+
build:
92+
context: "/System/Volumes/Data/Users/Shared/www/git/docker-php-apache/app/images/php-fpm"
93+
dockerfile: DockerfileXDebug
94+
container_name: "php-fpm-xdebug"
95+
environment: *php-env
96+
networks: *php-networks
97+
volumes: *php-volumes
98+
99+
volumes:
100+
nfsmount:
101+
driver: local
102+
driver_opts:
103+
type: nfs
104+
o: addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3
105+
device: ":/System/Volumes/Data/Users/Shared/www/public_html"
106+
nfsmount2:
107+
driver: local
108+
driver_opts:
109+
type: nfs
110+
o: addr=host.docker.internal,rw,nolock,hard,nointr,nfsvers=3
111+
device: ":/System/Volumes/Data/Users/Shared/www/git"
112+
shared:
113+
114+
networks:
115+
dev_network:
116+
driver: "bridge"
117+
name: "dev_network"

app/images/httpd/Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Pull base image.
2+
FROM httpd:2.4
3+
4+
COPY ./usr/local/apache2/conf/httpd.conf /usr/local/apache2/conf/httpd.conf
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Taken from ./original/httpd.conf
2+
3+
ServerRoot "/usr/local/apache2"
4+
ServerAdmin admin@dev.localhost
5+
ServerName dev.localhost:9080
6+
Listen 9080
7+
Listen 9443
8+
9+
# Modules
10+
LoadModule authn_file_module modules/mod_authn_file.so
11+
LoadModule authn_core_module modules/mod_authn_core.so
12+
LoadModule authz_host_module modules/mod_authz_host.so
13+
LoadModule authz_groupfile_module modules/mod_authz_groupfile.so
14+
LoadModule authz_user_module modules/mod_authz_user.so
15+
LoadModule authz_core_module modules/mod_authz_core.so
16+
LoadModule access_compat_module modules/mod_access_compat.so
17+
LoadModule auth_basic_module modules/mod_auth_basic.so
18+
LoadModule reqtimeout_module modules/mod_reqtimeout.so
19+
LoadModule filter_module modules/mod_filter.so
20+
LoadModule mime_module modules/mod_mime.so
21+
LoadModule log_config_module modules/mod_log_config.so
22+
LoadModule env_module modules/mod_env.so
23+
LoadModule headers_module modules/mod_headers.so
24+
LoadModule setenvif_module modules/mod_setenvif.so
25+
LoadModule version_module modules/mod_version.so
26+
LoadModule proxy_module modules/mod_proxy.so
27+
LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so
28+
LoadModule unixd_module modules/mod_unixd.so
29+
LoadModule status_module modules/mod_status.so
30+
LoadModule autoindex_module modules/mod_autoindex.so
31+
LoadModule dir_module modules/mod_dir.so
32+
LoadModule alias_module modules/mod_alias.so
33+
LoadModule rewrite_module modules/mod_rewrite.so
34+
LoadModule ssl_module modules/mod_ssl.so
35+
LoadModule mpm_worker_module modules/mod_mpm_worker.so
36+
37+
<IfModule unixd_module>
38+
User www-data
39+
Group www-data
40+
</IfModule>
41+
42+
<Directory />
43+
AllowOverride none
44+
Require all denied
45+
</Directory>
46+
47+
# Base host configuration
48+
DocumentRoot "/var/www/html"
49+
<Directory "/var/www/html">
50+
Options Indexes FollowSymLinks
51+
AllowOverride All
52+
Require all granted
53+
</Directory>
54+
55+
<FilesMatch \.php$>
56+
SetHandler "proxy:unix:/shared/var/run/php-fpm.sock|fcgi://localhost/"
57+
</FilesMatch>
58+
59+
<IfModule dir_module>
60+
DirectoryIndex index.php
61+
</IfModule>
62+
63+
<Files ".ht*">
64+
Require all denied
65+
</Files>
66+
67+
# Logging
68+
ErrorLog "/var/log/httpd/error.log"
69+
LogLevel warn
70+
71+
<IfModule log_config_module>
72+
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
73+
LogFormat "%h %l %u %t \"%r\" %>s %b" common
74+
CustomLog "/var/log/httpd/access.log" common
75+
</IfModule>
76+
77+
# Other configuration
78+
<IfModule headers_module>
79+
RequestHeader unset Proxy early
80+
</IfModule>
81+
82+
<IfModule mime_module>
83+
TypesConfig conf/mime.types
84+
AddType application/x-compress .Z
85+
AddType application/x-gzip .gz .tgz
86+
</IfModule>
87+
88+
IncludeOptional /usr/local/apache2/conf.d/*.conf

app/images/mariadb/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
FROM mariadb:10.5
2+
3+
COPY etc/mysql/my.cnf /etc/mysql/my.cnf

app/images/mariadb/etc/mysql/my.cnf

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[client]
2+
default-character-set = utf8mb4
3+
4+
[mysqld]
5+
character-set-server = utf8mb4
6+
collation-server = utf8mb4_unicode_ci
7+
join-cache-level = 0
8+
9+
[mysql]
10+
default-character-set = utf8mb4

app/images/nginx/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Pull base image.
2+
FROM nginx:1
3+
4+
COPY ./etc/nginx/nginx.conf /etc/nginx/nginx.conf
5+
COPY ./etc/nginx/fastcgi.conf.tpl /etc/nginx/fastcgi.conf.tpl
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
fastcgi_param QUERY_STRING ${DOLLAR}query_string;
2+
fastcgi_param REQUEST_METHOD ${DOLLAR}request_method;
3+
fastcgi_param CONTENT_TYPE ${DOLLAR}content_type;
4+
fastcgi_param CONTENT_LENGTH ${DOLLAR}content_length;
5+
6+
fastcgi_param SCRIPT_NAME ${DOLLAR}fastcgi_script_name;
7+
fastcgi_param REQUEST_URI ${DOLLAR}request_uri;
8+
fastcgi_param DOCUMENT_URI ${DOLLAR}fastcgi_path_info;
9+
fastcgi_param DOCUMENT_ROOT ${DOLLAR}realpath_root;
10+
fastcgi_param SERVER_PROTOCOL ${DOLLAR}server_protocol;
11+
fastcgi_param HTTPS ${DOLLAR}https if_not_empty;
12+
13+
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
14+
fastcgi_param SERVER_SOFTWARE nginx/${DOLLAR}nginx_version;
15+
16+
fastcgi_param REMOTE_ADDR ${DOLLAR}remote_addr;
17+
fastcgi_param REMOTE_PORT ${DOLLAR}remote_port;
18+
fastcgi_param SERVER_ADDR ${DOLLAR}server_addr;
19+
fastcgi_param SERVER_PORT ${DOLLAR}server_port;
20+
fastcgi_param SERVER_NAME ${DOLLAR}server_name;
21+
22+
# PHP only, required if PHP was built with --enable-force-cgi-redirect
23+
fastcgi_param REDIRECT_STATUS 200;
24+
25+
fastcgi_param PATH_INFO ${DOLLAR}fastcgi_path_info;
26+
fastcgi_param SCRIPT_FILENAME ${DOLLAR}realpath_root${DOLLAR}fastcgi_script_name;
27+
28+
# http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_split_path_info
29+
#fastcgi_split_path_info ${FASTCGI_SPLIT_PATH_INFO};
30+
31+
#fastcgi_intercept_errors ${FASTCGI_INTERCEPT_ERRORS};
32+
#fastcgi_ignore_client_abort ${FASTCGI_IGNORE_CLIENT_ABORT};
33+
#fastcgi_connect_timeout ${FASTCGI_CONNECT_TIMEOUT};
34+
#fastcgi_send_timeout ${FASTCGI_SEND_TIMEOUT};
35+
#fastcgi_read_timeout ${FASTCGI_READ_TIMEOUT};
36+
#fastcgi_buffer_size ${FASTCGI_BUFFER_SIZE};
37+
#fastcgi_buffers ${FASTCGI_BUFFERS};
38+
#fastcgi_busy_buffers_size ${FASTCGI_BUSY_BUFFERS_SIZE};
39+
#fastcgi_temp_file_write_size ${FASTCGI_TEMP_FILE_WRITE_SIZE};

app/images/nginx/etc/nginx/nginx.conf

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
user www-data www-data; # Let nginx access /var/run/php-fpm.sock
2+
worker_processes 3;
3+
4+
error_log /var/log/nginx/error.log warn;
5+
pid /var/run/nginx.pid;
6+
7+
events {
8+
worker_connections 1024;
9+
}
10+
11+
http {
12+
include /etc/nginx/mime.types;
13+
default_type application/octet-stream;
14+
15+
# Support for file uploads
16+
client_max_body_size 100m;
17+
18+
# Logging Settings
19+
log_format access '$remote_addr $http_host [$time_local] "$request" '
20+
'$status $body_bytes_sent $request_time "$http_referer" '
21+
'"$http_user_agent" "$http_x_forwarded_for"';
22+
23+
access_log /var/log/nginx/access.log access;
24+
25+
ssl_prefer_server_ciphers on;
26+
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
27+
ssl_ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:ECDH+3DES:DH+3DES:RSA+AESGCM:RSA+AES:RSA+3DES:!aNULL:!MD5:!DSS:!AES256;
28+
29+
sendfile on;
30+
31+
keepalive_timeout 15s;
32+
33+
# Define available upstreams
34+
upstream php-fpm {
35+
server unix:/shared/var/run/php-fpm.sock;
36+
}
37+
38+
# Define available upstreams
39+
upstream php-fpm-xdebug {
40+
server unix:/shared/var/run/php-fpm-xdebug.sock;
41+
}
42+
43+
# XDebug mappings.
44+
map $arg_XDEBUG_SESSION_START $session_arg_pass {
45+
default php-fpm;
46+
1 php-fpm-xdebug;
47+
}
48+
49+
map $cookie_XDEBUG_SESSION $cookie_arg_pass {
50+
default $session_arg_pass;
51+
xdebug php-fpm-xdebug;
52+
1 php-fpm-xdebug;
53+
PHPSTORM php-fpm-xdebug;
54+
XDEBUG_ECLIPSE php-fpm-xdebug;
55+
}
56+
57+
map $arg_XDEBUG_PROFILE $xdebug_test_pass {
58+
default $cookie_arg_pass;
59+
1 php-fpm-xdebug;
60+
}
61+
62+
include /etc/nginx/conf.d/*.conf;
63+
include /etc/nginx/sites-enabled/*.conf;
64+
}

app/images/nginx/root/bash_profile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#+-----------+
2+
#| XenForo 2 |
3+
#+-----------+
4+
5+
alias xf2='php cmd.php $*'
6+
7+
xf2-build() {
8+
php cmd.php xf-addon:sync-json "$1" -v -f
9+
php cmd.php xf-addon:build-release "$1" -v
10+
}
11+
12+
xf2-release() {
13+
robo release $1 $2 --repoDir="$PWD/src/addons/$1" --changeLogDir="$PWD/src/addons/$1/_no_upload" --load-from /var/www/html/robo
14+
}
15+
16+
xf2-changelog() {
17+
robo change:log $1 $2 --changeLogDir="$PWD/src/addons/$1/_no_upload" --load-from /var/www/html/robo
18+
}
19+
20+
xf2-phpstorm() {
21+
php cmd.php xf-dev:generate-phpstorm-meta
22+
}
23+
24+
xf2-import() {
25+
php cmd.php xf-dev:import --addon=$1
26+
}
27+
28+
xf2-export() {
29+
php cmd.php xf-dev:export --addon=$1
30+
}
31+
32+
xf2-better-export() {
33+
php cmd.php tck-devtools:better-export $1 --skip-export
34+
php cmd.php tck-devtools:build-readme $1 --markdown --copy
35+
}

app/images/nginx/root/ssh/config

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
Host *
2+
AddKeysToAgent yes
3+
4+
Host github.com
5+
HostName ssh.github.com
6+
Port 443
7+
PreferredAuthentications publickey
8+
AddKeysToAgent yes
9+
IdentityFile /var/www/git/docker-php-apache/github.pkey

0 commit comments

Comments
 (0)