forked from LiveCarta/LiveCartaWP
LAW-5954
This commit is contained in:
30
devops/Dockerfile
Normal file
30
devops/Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM wordpress:4.9-fpm
|
||||
|
||||
ENV TMP /tmp/nginx-php/
|
||||
|
||||
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
|
||||
|
||||
# Install composer
|
||||
RUN curl -sS https://getcomposer.org/installer | php -- \
|
||||
--filename=composer \
|
||||
--install-dir=/usr/local/bin && \
|
||||
echo "alias composer='composer'" >> /root/.bashrc && \
|
||||
composer
|
||||
|
||||
# php configs
|
||||
COPY www.conf /usr/local/etc/php-fpm.d/www.conf
|
||||
COPY docker-php.ini /usr/local/etc/php/conf.d/docker-php.ini
|
||||
|
||||
RUN apt-get install -y nginx
|
||||
|
||||
# nginx configs
|
||||
COPY nginx /etc/nginx
|
||||
|
||||
WORKDIR /var/www
|
||||
|
||||
EXPOSE 80
|
||||
@@ -1,45 +0,0 @@
|
||||
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:
|
||||
1
devops/docker-php.ini
Normal file
1
devops/docker-php.ini
Normal file
@@ -0,0 +1 @@
|
||||
memory_limit = 512M
|
||||
3
devops/nginx/conf.d/default.conf
Normal file
3
devops/nginx/conf.d/default.conf
Normal file
@@ -0,0 +1,3 @@
|
||||
upstream php-upstream {
|
||||
server 127.0.0.1:9000;
|
||||
}
|
||||
70
devops/nginx/env/dev/lawcarta_wordpress.conf
vendored
70
devops/nginx/env/dev/lawcarta_wordpress.conf
vendored
@@ -1,70 +0,0 @@
|
||||
server {
|
||||
|
||||
server_name dev1.lawcarta.com dev1.livecarta.com;
|
||||
|
||||
root /var/www/WordPress/htdocs/;
|
||||
index index.html index.php;
|
||||
|
||||
error_log /var/log/nginx/wordpress-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.conf;
|
||||
fastcgi_split_path_info ^(.+\.php)(/.+)$;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_pass unix:/run/php/php7.1-fpm.sock;
|
||||
fastcgi_read_timeout 300;
|
||||
}
|
||||
|
||||
location ~ /\.ht {
|
||||
deny all;
|
||||
}
|
||||
|
||||
listen 443 ssl; # managed by Certbot
|
||||
ssl_certificate /etc/letsencrypt/live/dev1.lawcarta.com/fullchain.pem; # managed by Certbot
|
||||
ssl_certificate_key /etc/letsencrypt/live/dev1.lawcarta.com/privkey.pem; # managed by Certbot
|
||||
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
|
||||
|
||||
|
||||
if ($scheme != "https") {
|
||||
return 301 https://$host$request_uri;
|
||||
} # managed by Certbot
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
server {
|
||||
if ($host = dev1.livecarta.com) {
|
||||
return 301 https://$host$request_uri;
|
||||
} # managed by Certbot
|
||||
|
||||
|
||||
if ($host = dev1.lawcarta.com) {
|
||||
return 301 https://$host$request_uri;
|
||||
} # managed by Certbot
|
||||
|
||||
|
||||
listen 80;
|
||||
listen [::]:80;
|
||||
|
||||
server_name dev1.lawcarta.com dev1.livecarta.com;
|
||||
return 404; # managed by Certbot
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
|
||||
user nginx;
|
||||
user www-data;
|
||||
worker_processes 1;
|
||||
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
@@ -10,7 +10,6 @@ events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
@@ -30,34 +29,6 @@ http {
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
include /etc/nginx/conf.d/*.conf;
|
||||
include /etc/nginx/sites-available/*.conf;
|
||||
}
|
||||
30
devops/nginx/sites-available/default.conf
Normal file
30
devops/nginx/sites-available/default.conf
Normal file
@@ -0,0 +1,30 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name lawcarta.loc livecarta.loc localhost;
|
||||
|
||||
root /var/www;
|
||||
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 localhost:9000;
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
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
|
||||
10
devops/www.conf
Normal file
10
devops/www.conf
Normal file
@@ -0,0 +1,10 @@
|
||||
[www]
|
||||
|
||||
user = www-data
|
||||
group = www-data
|
||||
|
||||
pm = dynamic
|
||||
pm.max_children = 50
|
||||
pm.start_servers = 2
|
||||
pm.min_spare_servers = 1
|
||||
pm.max_spare_servers = 3
|
||||
14
environments/dev_amazon/domain_db_fix.sql
Normal file
14
environments/dev_amazon/domain_db_fix.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
######FOR TEST DEV ENV
|
||||
|
||||
update wp_options set option_value = "https://doc-dev.lawcarta.com" where option_id = 1 limit 1;
|
||||
update wp_options set option_value = "https://doc-dev.lawcarta.com" where option_id = 2 limit 1;
|
||||
|
||||
update wp_2_options set option_value = "https://doc-dev.livecarta.com" where option_id = 1 limit 1;
|
||||
update wp_2_options set option_value = "https://doc-dev.lawcarta.com/livecarta" where option_id = 2 limit 1;
|
||||
|
||||
update wp_blogs set domain = "doc-dev.lawcarta.com" where blog_id = 1 limit 1;
|
||||
update wp_blogs set domain = "doc-dev.lawcarta.com" where blog_id = 2 limit 1;
|
||||
|
||||
update wp_domain_mapping set domain = "doc-dev.livecarta.com" where blog_id = 2 limit 1;
|
||||
|
||||
update wp_site set domain = "doc-dev.lawcarta.com" where id =1 limit 1;
|
||||
2
environments/dev_amazon/robots.txt
Normal file
2
environments/dev_amazon/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
21
environments/dev_amazon/wp-config-local.php
Normal file
21
environments/dev_amazon/wp-config-local.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
define( 'DB_NAME', '@lcWpMySqlDbnameDev@' );
|
||||
define( 'DB_USER', '@lcWpMySqlUsernameDev@' );
|
||||
define( 'DB_PASSWORD', '@lcWpMySqlPasswordDev@' );
|
||||
define( 'DB_HOST', '@lcWpMySqlHostDev@' );
|
||||
|
||||
define('DOMAIN_CURRENT_SITE', 'doc-dev.lawcarta.com');
|
||||
|
||||
define('LAWCARTA_SUBDOMAIN', 'app-dev');
|
||||
define('LAWCARTA_PORT', '');
|
||||
|
||||
define('LAWCARTA_WP_REST_API_REQUEST_URL', 'https://app-dev.lawcarta.com/v1/event/request');
|
||||
define('LAWCARTA_WP_REST_API_RESPONSE_URL', 'https://app-dev.lawcarta.com/v1/event/response');
|
||||
|
||||
define('LAWCARTA_ENVIRONMENT_NAME', 'dev');
|
||||
|
||||
define('LC_ALLOW_COOKIE_POPUP', true);
|
||||
define('LC_GTM', 'GTM-KXTRR4Q');
|
||||
|
||||
$_SERVER['HTTPS'] = 'On';
|
||||
Reference in New Issue
Block a user