3
2

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.

macにdocker-composeでwordpressをたてる

Posted at

作業ディレクトリを作ってその中に入る。

docker-compose.ymlを作成し以下を記述。

version: '3'

services:
  smtp:
    image: schickling/mailcatcher
    ports:
      - 1081:1080
      - 1025:1025
  db:
    image: mysql:5.7
    ports:
      - 3314:3306
    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
      - smtp
    image: wordpress:5.2.2-php7.3
    volumes:
      - ./work:/var/www/html
    ports:
      - 8003:80
    restart: always
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress

volumes:
    db_data:

docker-compose up でbuild、起動。
localhost:8003 にブラウザでアクセス。

カンタン!!

参考

3
2
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
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?