RammusXu / rammusxu.github.io

My profile
https://rammusxu.github.io/
2 stars 0 forks source link

Docker - 用Windows架設Wordpress的坑 #52

Closed RammusXu closed 7 years ago

RammusXu commented 8 years ago
 version: '2'

 services:
   db:
     image: mysql:5.7
     volumes:
       - "./.data/db:/var/lib/mysql"
     restart: always
     environment:
       MYSQL_ROOT_PASSWORD: wordpress
       MYSQL_DATABASE: wordpress
       MYSQL_USER: wordpress
       MYSQL_PASSWORD: wordpress

   wordpress:
     depends_on:
       - db
     image: wordpress:latest
     volumes:
       - "./web:/var/www/html"
     links:
       - db
     ports:
       - "8000:80"
     restart: always
     environment:
       WORDPRESS_DB_HOST: db:3306
       WORDPRESS_DB_PASSWORD: wordpress
docker-compose up
docker-compose up -d
docker-compose down
create uploads.ini then, content is

file_uploads = On
memory_limit = 64M
upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 600
use fig.yml solution, to replace uploads.ini

db:
  image: mysql:latest
  environment:
    MYSQL_ROOT_PASSWORD: "PASSWORD-HERE"

wordpress:
  image: wordpress:latest
  ports:
    - "80:80"
  links:
    - db:mysql
  volumes:
    - uploads.ini:/usr/local/etc/php/conf.d/uploads.ini

Reference