Skip to content

Create docker-compose file. #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Aug 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions custom.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
file_uploads = On
memory_limit = 256M
upload_max_filesize = 64M
max_input_vars = 3000
post_max_size = 64M
max_execution_time = 600
36 changes: 36 additions & 0 deletions default
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
server {
listen 80;
listen [::]:80;
server_name _;
return 301 https://$host$request_uri;
}

server {
listen 443 ssl http2 default_server;
listen [::]:443 ssl http2 default_server;

root /var/www/html/example;
index index.html index.htm index.php;

server_name _;

include /config/nginx/proxy-confs/*.subfolder.conf;

include /config/nginx/ssl.conf;

client_max_body_size 0;

location / {
try_files $uri $uri/ /index.php?$args @app;
}

location @app {
proxy_pass http://wordpress;
proxy_set_header Host $host;
proxy_redirect off;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_set_header X-Real-IP $remote_addr;
}

}
56 changes: 56 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: '3.3'

services:

letsencrypt:
image: linuxserver/letsencrypt
container_name: letsencrypt
depends_on:
- wordpress
volumes:
- ./config:/config
- ./default:/config/nginx/site-confs/default
environment:
- EMAIL=email@example.com
- URL=www.example.com
- VALIDATION=http
- TZ=Europe/London
- PUID=500
- PGID=500
ports:
- "443:443"
- "80:80"

wordpress:
image: wordpress:latest
container_name: wordpress
hostname: wordpress
depends_on:
- db
restart: always
ports:
- "8080:80"
volumes:
- /var/www/html/example/wp-content:/var/www/html/wp-content
- /var/www/html/example/custom.ini:/usr/local/etc/php/conf.d/custom.ini
environment:
WORDPRESS_DB_HOST: db
WORDPRESS_DB_USER: wp_db_user
WORDPRESS_DB_PASSWORD: wp_db_pass
WORDPRESS_DB_NAME: wp_db_name
WORDPRESS_CONFIG_EXTRA: |
define( 'WP_MEMORY_LIMIT', '96M' );

db:
image: mysql:5.7
container_name: db
volumes:
- /var/lib/mysql:/var/lib/mysql
restart: always
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: mysql_root_pass
MYSQL_DATABASE: wp_db_name
MYSQL_USER: wp_db_user
MYSQL_PASSWORD: wp_db_pass
1 change: 1 addition & 0 deletions wp-content/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@