Last active
August 28, 2025 00:22
-
-
Save segfo/2e88a3e77e3d2fb5cefc79d527330224 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 同じディレクトリに .env を作ってください。 | |
| # .envのサンプルはgistのコメントに書きます。 | |
| services: | |
| # パスワードマネージャ 不要なら消してね | |
| vaultwarden: | |
| image: vaultwarden_arm64:1.34.3 | |
| container_name: vaultwarden | |
| user: '1000:1000' | |
| ports: | |
| - 8080:80 | |
| environment: | |
| - DOMAIN=${VAULTWARDEN_DOMAIN} | |
| - SIGNUPS_ALLOWED=${VAULTWARDEN_SIGNUPS_ALLOWED} | |
| - ROCKET_PORT=80 | |
| - EXPERIMENTAL_CLIENT_FEATURE_FLAGS=ssh-key-vault-item,ssh-agent | |
| volumes: | |
| - ./vw-data:/data | |
| restart: unless-stopped | |
| # DNS型広告ブロッカー | |
| pihole: | |
| image: pihole/pihole:latest | |
| container_name: pihole | |
| cap_add: | |
| - NET_ADMIN | |
| environment: | |
| - TZ=${TZ} | |
| - PIHOLE_UID=${PUID} | |
| - PIHOLE_GID=${PGID} | |
| volumes: | |
| - ./etc/pihole:/etc/pihole | |
| - ./etc/dnsmasq.d:/etc/dnsmasq.d | |
| ports: | |
| - "53:53/tcp" | |
| - "53:53/udp" | |
| restart: unless-stopped | |
| # pi-holeのUI用のリバプロ。TLS通信の終端の役割をしている。不要なら消してね | |
| nginx: | |
| image: nginx:latest | |
| container_name: nginx | |
| depends_on: | |
| - pihole | |
| ports: | |
| - 10443:443 | |
| volumes: | |
| - ./nginx/conf.d:/etc/nginx/conf.d | |
| - ./nginx/certs:/etc/nginx/certs | |
| restart: unless-stopped | |
| # ローカルCA、生成したTLS証明書をNginxに食わせる | |
| stepca: | |
| image: smallstep/step-ca | |
| container_name: stepca | |
| volumes: | |
| - ./step-ca:/home/step | |
| ports: | |
| - 8443:443 # ACME endpoint | |
| restart: unless-stopped | |
| networks: | |
| internal_net: | |
| driver: bridge |
Author
Author
ディレクトリ構成
server
├── .env <環境変数(compose.ymlとLocalCA構築・運用スクリプト共用)>
├── compose.yml
├── etc <piholeのフォルダ>
│ ├── dnsmasq.d
│ └── pihole
├── logs <TLS証明書の再発行スクリプトのログなど>
├── nginx <TLSの終端・リバースプロキシ>
│ ├── certs <各サーバの証明書>
│ │ ├── server.crt
│ │ ├── server.csr
│ │ └── server.key
│ └── conf.d <リバプロの構成ファイル>
│ └── pihole.conf <pihole用>
├── scripts
│ ├── ca-setup.sh
│ ├── cert-renew-and-reload.sh
│ └── create-cert.sh
├── step-ca <scripts/ca-setup.shを実行すると作成される>
└── vw-data <vaultwardenのDBデータ>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nignxの設定ファイル