From f5e467219d77585b5c31d2701424d7fd30e33e0c Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Mon, 2 Jan 2023 01:15:12 +0900 Subject: [PATCH] add usage and example --- .drone.yml | 1 + README.md | 19 +++++++++++++++++++ example/compose.yml | 12 ++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 example/compose.yml diff --git a/.drone.yml b/.drone.yml index bc1425a..46a5dec 100644 --- a/.drone.yml +++ b/.drone.yml @@ -19,6 +19,7 @@ steps: - docker context create --docker=host=ssh://ubuntu@beta.fogtype.com beta - docker context use beta - docker compose --project-name=beta up --detach + - docker compose --project-directory=example up --detach volumes: - name: ssh_key path: /home/ubuntu/.ssh/id_ed25519 diff --git a/README.md b/README.md index 56cf963..ec9054b 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,25 @@ beta.fogtype.com : 使い捨て実行環境 +## Usage + +1. beta.fogtype.com に SSH でアクセス +2. `caddy`、`caddy.reverse_proxy` ラベルを与えて Docker コンテナを実行 + - 例: `--label=caddy=example.beta.fogtype.com --label=caddy.reverse_proxy={{upstreams}}` +3. `caddy` ネットワークにアタッチ + +詳しい使い方は [caddy-docker-proxy](https://github.com/lucaslorentz/caddy-docker-proxy#readme) を参照 + +## Example + +[example/compose.yml](example/compose.yml) + +```sh +docker context create --docker=host=ssh://ubuntu@beta.fogtype.com beta +docker context use beta +docker compose --project-directory=example up -d +``` + ## Setup ```sh diff --git a/example/compose.yml b/example/compose.yml new file mode 100644 index 0000000..fe46cc7 --- /dev/null +++ b/example/compose.yml @@ -0,0 +1,12 @@ +services: + example: + image: caddy:2.6.2-alpine + restart: unless-stopped + networks: + - caddy + labels: + caddy: example.beta.fogtype.com + caddy.reverse_proxy: "{{upstreams}}" +networks: + caddy: + external: true