Skip to content

Instantly share code, notes, and snippets.

@dingo-d
Last active July 9, 2019 10:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dingo-d/65beffa6adbee0aa0aa45d44d78f73b3 to your computer and use it in GitHub Desktop.
Save dingo-d/65beffa6adbee0aa0aa45d44d78f73b3 to your computer and use it in GitHub Desktop.
version: '3.3'
services:
app:
image: wordpress:5.2.0-php7.2-fpm
container_name: wptest-app
depends_on:
- db
- redis
restart: always
volumes:
- ./bin/php.ini:/usr/local/etc/php/conf.d/local.ini
- .:/var/www/html
environment:
WORDPRESS_DB_HOST: wptest-db
WORDPRESS_DB_NAME: wptest
WORDPRESS_DB_USER: wp
WORDPRESS_DB_PASSWORD: wp
expose:
- "80"
db:
image: mysql:5.7
container_name: wptest-db
restart: always
volumes:
- db_wptest_data:/var/lib/mysql
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 1
MYSQL_DATABASE: wptest
MYSQL_USER: wp
MYSQL_PASSWORD: wp
ports:
- "33066:3306"
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: wptest-phpmyadmin
external_links:
- db
ports:
- 8081:80
depends_on:
- db
environment:
MYSQL_RANDOM_ROOT_PASSWORD: 1
MYSQL_USERNAME: root
nginx:
image: nginx
container_name: wptest-nginx
restart: always
volumes:
- .:/var/www/html
depends_on:
- app
volumes:
- ./bin/nginx.conf:/etc/nginx/conf.d/default.conf
- .:/var/www/html
- ./logs:/var/log/nginx
ports:
- 8010:80
redis:
image: redis
container_name: wptest-redis
expose:
- 6379
ports:
- 6379:6379
volumes:
db_wptest_data:
## secure headers
# https://www.owasp.org/index.php/OWASP_Secure_Headers_Project#xxxsp
add_header X-Xss-Protection "1; mode=block" always;
# https://www.owasp.org/index.php/OWASP_Secure_Headers_Project#xfo
add_header X-Frame-Options "SAMEORIGIN" always;
# https://www.owasp.org/index.php/OWASP_Secure_Headers_Project#xcto
add_header X-Content-Type-Options "nosniff" always;
## global fastcgi config
fastcgi_hide_header X-Powered-By;
fastcgi_pass_header Authorization;
server {
listen 80;
add_header Strict-Transport-Security "max-age=31536000" always;
root /var/www/html;
index index.php;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
client_max_body_size 64M;
location / {
try_files $uri $uri/ /index.php?$args;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
file_uploads = On
memory_limit = 512M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 600
; enable opcache
opcache.enable_cli = 1
opcache.enable = 1
opcache.fast_shutdown = 1
; revalidate everytime (effectively disabled for development)
opcache.validate_timestamps = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment