feat(docker): move bitrix and uploads to volumes

add site directory to /home/bitrix
add nginx and apache configs
parent dec8c630
VIRTUAL_HOST=DEV-%PROJECT_NUM%.zolotoykod.ru
HTTP_PORT=8080
VIRTUAL_HOST=DEV-1-111.zolotoykod.ru
BITRIX_PORT=8081
SITE_PORT=8080
......@@ -6,19 +6,30 @@ services:
working_dir: /home/bitrix/www
command: sudo /run.sh
volumes:
- ./www:/home/bitrix/www:Z
- bitrix:/home/bitrix/www/bitrix:Z
- upload:/home/bitrix/www/upload:Z
- data:/var/lib/mysql:Z
- ./www:/home/bitrix/site:Z
- ./docker/apache/bitrix.conf:/etc/httpd/bx/conf/default.conf:ro
- ./docker/nginx/bitrix.conf:/etc/nginx/bx/site_avaliable/s1.conf:ro
- ./docker/apache/site.conf:/etc/httpd/bx/conf/site.conf:ro
- ./docker/nginx/site.conf:/etc/nginx/bx/site_enabled/site.conf:ro
ports:
- "${HTTP_PORT}:80"
- "${BITRIX_PORT}:80"
- "${SITE_PORT}:8080"
- "22"
environment:
- HOME=/home/bitrix
- VIRTUAL_HOST
dns:
- 8.8.8.8
- 8.8.4.4
tty: true
volumes:
data:
driver: local
bitrix:
driver: local
upload:
driver: local
Listen 127.0.0.1:8888
<VirtualHost 127.0.0.1:8888>
#ServerAdmin webmaster@localhost
DocumentRoot /home/bitrix/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<DirectoryMatch .*\.svn/.*>
Deny From All
</DirectoryMatch>
<DirectoryMatch .*\.git/.*>
Deny From All
</DirectoryMatch>
<DirectoryMatch .*\.hg/.*>
Deny From All
</DirectoryMatch>
<Directory /home/bitrix/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
DirectoryIndex index.php index.html index.htm
Order allow,deny
allow from all
php_admin_value session.save_path /tmp/php_sessions/www
php_admin_value upload_tmp_dir /tmp/php_upload/www
</Directory>
<Directory /home/bitrix/www/bitrix/cache>
AllowOverride none
Order allow,deny
Deny from all
</Directory>
<Directory /home/bitrix/www/bitrix/managed_cache>
AllowOverride none
Order allow,deny
Deny from all
</Directory>
<Directory /home/bitrix/www/bitrix/local_cache>
AllowOverride none
Order allow,deny
Deny from all
</Directory>
<Directory /home/bitrix/www/bitrix/stack_cache>
AllowOverride none
Order allow,deny
Deny from all
</Directory>
<Directory /home/bitrix/www/upload>
AllowOverride none
AddType text/plain php,php3,php4,php5,php6,phtml,pl,asp,aspx,cgi,dll,exe,ico,shtm,shtml,fcg,fcgi,fpl,asmx,pht
php_value engine off
</Directory>
<Directory /home/bitrix/www/upload/support/not_image>
AllowOverride none
Order allow,deny
Deny from all
</Directory>
<Directory /home/bitrix/www/bitrix/images>
AllowOverride none
AddType text/plain php,php3,php4,php5,php6,phtml,pl,asp,aspx,cgi,dll,exe,ico,shtm,shtml,fcg,fcgi,fpl,asmx,pht
php_value engine off
</Directory>
<Directory /home/bitrix/www/bitrix/tmp>
AllowOverride none
AddType text/plain php,php3,php4,php5,php6,phtml,pl,asp,aspx,cgi,dll,exe,ico,shtm,shtml,fcg,fcgi,fpl,asmx,pht
php_value engine off
</Directory>
ErrorLog logs/error_log
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
LogLevel warn
CustomLog logs/access_log combined
<IfModule mod_rewrite.c>
#Nginx should have "proxy_set_header HTTPS YES;" in location
RewriteEngine On
RewriteCond %{HTTP:HTTPS} =YES
RewriteRule .* - [E=HTTPS:on,L]
</IfModule>
</VirtualHost>
Listen 127.0.0.1:8887
<VirtualHost 127.0.0.1:8887>
#ServerAdmin webmaster@localhost
DocumentRoot /home/bitrix/site
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<DirectoryMatch .*\.svn/.*>
Deny From All
</DirectoryMatch>
<DirectoryMatch .*\.git/.*>
Deny From All
</DirectoryMatch>
<DirectoryMatch .*\.hg/.*>
Deny From All
</DirectoryMatch>
<Directory /home/bitrix/site/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
DirectoryIndex index.php index.html index.htm
Order allow,deny
allow from all
php_admin_value session.save_path /tmp/php_sessions/www
php_admin_value upload_tmp_dir /tmp/php_upload/www
</Directory>
<Directory /home/bitrix/site/bitrix/cache>
AllowOverride none
Order allow,deny
Deny from all
</Directory>
<Directory /home/bitrix/site/bitrix/managed_cache>
AllowOverride none
Order allow,deny
Deny from all
</Directory>
<Directory /home/bitrix/site/bitrix/local_cache>
AllowOverride none
Order allow,deny
Deny from all
</Directory>
<Directory /home/bitrix/site/bitrix/stack_cache>
AllowOverride none
Order allow,deny
Deny from all
</Directory>
<Directory /home/bitrix/site/upload>
AllowOverride none
AddType text/plain php,php3,php4,php5,php6,phtml,pl,asp,aspx,cgi,dll,exe,ico,shtm,shtml,fcg,fcgi,fpl,asmx,pht
php_value engine off
</Directory>
<Directory /home/bitrix/site/upload/support/not_image>
AllowOverride none
Order allow,deny
Deny from all
</Directory>
<Directory /home/bitrix/site/bitrix/images>
AllowOverride none
AddType text/plain php,php3,php4,php5,php6,phtml,pl,asp,aspx,cgi,dll,exe,ico,shtm,shtml,fcg,fcgi,fpl,asmx,pht
php_value engine off
</Directory>
<Directory /home/bitrix/site/bitrix/tmp>
AllowOverride none
AddType text/plain php,php3,php4,php5,php6,phtml,pl,asp,aspx,cgi,dll,exe,ico,shtm,shtml,fcg,fcgi,fpl,asmx,pht
php_value engine off
</Directory>
ErrorLog logs/error_log
# Possible values include: debug, info, notice, warn, error, crit, alert, emerg.
LogLevel warn
CustomLog logs/access_log combined
<IfModule mod_rewrite.c>
#Nginx should have "proxy_set_header HTTPS YES;" in location
RewriteEngine On
RewriteCond %{HTTP:HTTPS} =YES
RewriteRule .* - [E=HTTPS:on,L]
</IfModule>
</VirtualHost>
# Default website
server {
listen 80;
# server_name _;
# server_name_in_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host:80;
set $proxyserver "http://127.0.0.1:8888";
set $docroot "/home/bitrix/www";
index index.php;
root /home/bitrix/www;
# Redirect to ssl if need
if (-f /home/bitrix/www/.htsecure) { rewrite ^(.*)$ https://$host$1 permanent; }
# Include parameters common to all websites
include bx/conf/bitrix.conf;
# Include server monitoring locations
include bx/server_monitor.conf;
}
# Default website
server {
listen 8080;
# server_name _;
# server_name_in_redirect off;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host:80;
set $proxyserver "http://127.0.0.1:8887";
set $docroot "/home/bitrix/site";
index index.php;
root /home/bitrix/site;
# Redirect to ssl if need
if (-f /home/bitrix/site/.htsecure) { rewrite ^(.*)$ https://$host$1 permanent; }
# Include parameters common to all websites
include bx/conf/bitrix.conf;
# Include server monitoring locations
include bx/server_monitor.conf;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment