wordpress config + law-/live- carta themes

This commit is contained in:
Andrey Morgachev
2018-08-16 09:55:53 +03:00
commit 3b5be35fe8
65 changed files with 5457 additions and 0 deletions

1
devops/.env.sample Normal file
View File

@@ -0,0 +1 @@
COMPOSE_PROJECT_NAME=lawcarta_wp

4
devops/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
/storage/
.env
docker-compose.override.yml
*.sql

45
devops/docker-compose.yml Normal file
View File

@@ -0,0 +1,45 @@
version: '3'
services:
mysql:
image: mysql:5.7
volumes:
- "./storage/mysql:/var/lib/mysql"
- "./storage/logs/mysql:/var/log/mysql"
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-pass4dev}
- MYSQL_DATABASE=${MYSQL_DATABASE:-db4dev}
- MYSQL_USER=${MYSQL_USER:-user4dev}
- MYSQL_PASSWORD=${MYSQL_PASSWORD:-pass4dev}
restart: always
php_fpm:
build:
context: ./php_fpm
depends_on:
- mysql
volumes:
- "../htdocs/wp-content:/var/www/html/wp-content"
- "../htdocs/wp-config.php:/var/www/html/wp-config.php"
- "htdocs:/var/www/html"
environment:
- DB_NAME=${DB_NAME:-db4dev}
- DB_USER=${DB_USER:-user4dev}
- DB_PASSWORD=${DB_PASSWORD:-pass4dev}
- DB_HOST=${DB_HOST:-mysql}
restart: always
nginx:
image: nginx:1.15-alpine
depends_on:
- php_fpm
volumes:
- "./nginx/nginx.conf:/etc/nginx/nginx.conf:ro"
- "./storage/logs/nginx:/var/log/nginx"
- "../htdocs/wp-content:/var/www/html/wp-content"
- "../htdocs/wp-config.php:/var/www/html/wp-config.php:ro"
- "htdocs:/var/www/html"
restart: always
volumes:
htdocs:

63
devops/nginx/nginx.conf Normal file
View File

@@ -0,0 +1,63 @@
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
client_max_body_size 10m;
server {
listen 80;
server_name lawcarta.loc livecarta.loc;
root /var/www/html;
index index.php;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
if (!-e $request_filename) {
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
rewrite ^(/[^/]+)?(/wp-.*) $2 last;
rewrite ^(/[^/]+)?(/.*\.php) $2 last;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
include fastcgi_params;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
#fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_pass php_fpm:9000;
}
}
}

View File

@@ -0,0 +1,8 @@
FROM wordpress:4.9-fpm
RUN apt-get update && apt-get install -y --no-install-recommends \
libjpeg-dev \
libpng-dev \
libfreetype6-dev \
&& docker-php-ext-configure gd --with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir=/usr/include \
&& docker-php-ext-install gd