Skip to content

Instantly share code, notes, and snippets.

@Kennyl
Last active January 17, 2018 13:24
Show Gist options
  • Save Kennyl/72118e0738ed63d4ee6c7336f321a304 to your computer and use it in GitHub Desktop.
Save Kennyl/72118e0738ed63d4ee6c7336f321a304 to your computer and use it in GitHub Desktop.
Docker-Compose Wordpress Example
wordpress:
image: wordpress
links:
- wordpress_db:mysql
ports:
- 8080:80
volumes:
- ~/wordpress/html:/var/www/html
- /static
- another_static:/static2
wordpress_db:
image: mariadb
environment:
MYSQL_ROOT_PASSWORD: anypassword
phpmyadmin:
image: phpmyadmin
links:
- wordpress_db:mysql
ports:
- 8181:80
environment:
MYSQL_USERNAME: root
MYSQL_ROOT_PASSWORD: anypassword
version: '3'
services:
webserver:
image: richarvey/nginx-php-fpm:latest
volumes:
- data-volume:/var/www/html
ports:
- 8080:80
wordpress:
image: wordpress:php7.1-fpm-alpine
volumes:
- data-volume:/var/www/html
environment:
WORDPRESS_DB_HOST: dbserver
WORDPRESS_DB_PASSWORD: example
depends_on:
- webserver
- dbserver
dbserver:
image: mariadb:latest
environment:
MYSQL_ROOT_PASSWORD: example
ports:
- 3307:3306
volumes:
data-volume:
@Kennyl
Copy link
Author

Kennyl commented Mar 6, 2017

@Kennyl
Copy link
Author

Kennyl commented Mar 6, 2017

if not enough memory
resources:
limits:
cpus: '0.001'
memory: 50M
reservations:
cpus: '0.0001'
memory: 20M

@Kennyl
Copy link
Author

Kennyl commented Mar 9, 2017

docker-compose3.yml not efficiency but work for me
Not efficiency

  • double fpm
  • force nginx use wordpress /var/www/html by luck (depends_on )

@ugurayan
Copy link

wordpress_1 | MySQL Connection Error: (1045) Access denied for user 'root'@'172.17.0.6' (using password: YES)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment