0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

docker-composeで超簡単ローカルwordpress環境作り

Posted at

概要

  • ローカルにdocker以外なにも入れずにwordpressの環境をつくる
  • dbもdocker-composeに含まれています

環境

  • docker, docker-composeが使えればOK

手順

  1. 以下のdocker-compose.ymlを作成

    docker-compose.yml]
    version: '3.3'
    
    services:
       db:
         image: mysql:5.7
         volumes:
           - db_data:/var/lib/mysql
         restart: always
         environment:
           MYSQL_ROOT_PASSWORD: somewordpress
           MYSQL_DATABASE: wordpress
           MYSQL_USER: wordpress
           MYSQL_PASSWORD: wordpress
    
       wordpress:
         depends_on:
           - db
         image: wordpress:latest
         ports:
           - "8000:80"
         restart: always
         environment:
           WORDPRESS_DB_HOST: db:3306
           WORDPRESS_DB_USER: wordpress
           WORDPRESS_DB_PASSWORD: wordpress
           WORDPRESS_DB_NAME: wordpress
    volumes:
        db_data: {}
    
  2. docker-compose -d up

  3. http:localhost:8000にアクセス

  4. 各種wordpressの設定をして完了

昔と比べて簡単すぎません?

mysql入れたり、xamppやら入れたりしていた頃と大違い…

0
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?