version: '3.3' services: myapp: image: my-app environment: VIRTUAL_HOST: example.com,www.example.com # ← カンマ区切り指定 LETSENCRYPT_HOST: example.com,www.example.com # ← カンマ区切り指定 LETSENCRYPT_EMAIL: mail@example.com networks: default: external: name: shared version: "2" services: nginx-proxy: image: jwilder/nginx-proxy container_name: nginx-proxy ports: - "80:80" - "443:443" volumes: - /var/run/docker.so
![letsencrypt-nginx-proxy-companionを使って複数ドメイン名に無料SSL証明書を適用する - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/91ece8b4f3d292f8dce9c901567d1f3c17dcbf9b/height=288;version=1;width=512/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fcdn.qiita.com%252Fassets%252Fpublic%252Farticle-ogp-background-412672c5f0600ab9a64263b751f1bc81.png%3Fixlib%3Drb-4.0.0%26w%3D1200%26mark64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTk3MiZoPTM3OCZ0eHQ9bGV0c2VuY3J5cHQtbmdpbngtcHJveHktY29tcGFuaW9uJUUzJTgyJTkyJUU0JUJEJUJGJUUzJTgxJUEzJUUzJTgxJUE2JUU4JUE0JTg3JUU2JTk1JUIwJUUzJTgzJTg5JUUzJTgzJUExJUUzJTgyJUE0JUUzJTgzJUIzJUU1JTkwJThEJUUzJTgxJUFCJUU3JTg0JUExJUU2JTk2JTk5U1NMJUU4JUE4JUJDJUU2JTk4JThFJUU2JTlCJUI4JUUzJTgyJTkyJUU5JTgxJUE5JUU3JTk0JUE4JUUzJTgxJTk5JUUzJTgyJThCJnR4dC1hbGlnbj1sZWZ0JTJDdG9wJnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9NTYmcz02YTg5YmRjODI1ZTczZWM3MzRmYzA1MmM1NDQ4NTJhZA%26mark-x%3D142%26mark-y%3D57%26blend64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZoPTc2Jnc9NzcwJnR4dD0lNDBmdWt1eWFtYTAxMiZ0eHQtY29sb3I9JTIzMjEyMTIxJnR4dC1mb250PUhpcmFnaW5vJTIwU2FucyUyMFc2JnR4dC1zaXplPTM2JnR4dC1hbGlnbj1sZWZ0JTJDdG9wJnM9YzY1NDczZmMzYzRkYTg0NjQ5YjMyOWYzMGQ0MzhjYmM%26blend-x%3D142%26blend-y%3D486%26blend-mode%3Dnormal%26s%3Dfbd30fdc09940e53db4433ff604778b1)