add usage and example
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Nebel 2023-01-02 01:15:12 +09:00
parent a63ba657a7
commit f5e467219d
3 changed files with 32 additions and 0 deletions

View file

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

View file

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

12
example/compose.yml Normal file
View file

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