0
0

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 3 years have passed since last update.

docker-compose を使ってwordpressとmysqlを1コマンドで環境構築する

Posted at

参照サイト

https://knowledge.sakura.ad.jp/16862/
https://qiita.com/tegnike/items/bcdcee0320e11a928d46
https://coinbaby8.com/docker-beginner.html

上記の記事が参考になりました。

docker-compose.yml

version: '3'
services:

  wordpress:
    image: wordpress
    container_name: wordpress-docker-compose
    restart: always
    ports:
      - 8080:80
    environment:
      WORDPRESS_DB_PASSWORD: access-to-db-pw

  mysql:
    image: mysql:8.0
    container_name: mysql-docker-compose
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: access-to-db-pw

terminal-command

前提として、docker-compose.yml ファイルがあるディレクトリへcdで移動してください。

  • command:upでイメージのビルドからコンテナの作成までできるようです。
  • command:buildではイメージのビルドのみとなり、コンテナは作成されません。
  • option:-dをつけることで、バックグラウンドで起動することができます。
docker-compose up -d
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?