3
3

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.

PLISEAdvent Calendar 2020

Day 8

[WIP]最も簡単なWordpressのHTTPS化(Wordpress+https-portal+Docker+Docker-compose)

Last updated at Posted at 2020-12-07

目標

  • ローカル環境のWordpressにHTTPSでアクセスできること

前提

  • Dockerインストール済
  • Wordpressに触れたことがある

実行環境

  • CPU
    • Intel(R) Core(TM) i5-6400 CPU
  • OS
    • Windows 10 pro
      • バージョン 1909
  • アプリケーション
    • Docker
      • バージョン 19.03.13
  • 使用するDocker Image
    • mysql: 5.7
    • wordpress: latest
    • https-portal: 1

手順

  1. こちらよりdocker-composeの内容を転記

    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 upで起動することを確認

  3. http://localhost:8000 へアクセス

  4. 言語設定やユーザー設定などの初期登録を済ませる

  5. https-portalを追記

    version: '3.3'
    
    services:
    
      https-portal:
        image: steveltn/https-portal:1
        ports:
          - '443:443'
        environment:
          STAGE: local
          DOMAINS: 'localhost -> http://host.docker.internal:443'
    
       db:
         image: mysql:5.7
        ...
    
  6. docker-compose upで起動することを確認

  7. https://localhost へアクセス

総評

WIP

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?