Last active
January 17, 2018 13:24
-
-
Save Kennyl/72118e0738ed63d4ee6c7336f321a304 to your computer and use it in GitHub Desktop.
Docker-Compose Wordpress Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
if not enough memory
resources:
limits:
cpus: '0.001'
memory: 50M
reservations:
cpus: '0.0001'
memory: 20M
docker-compose3.yml not efficiency but work for me
Not efficiency
- double fpm
- force nginx use wordpress /var/www/html by luck (depends_on )
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
refer
https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-and-phpmyadmin-with-docker-compose-on-ubuntu-14-04