Skip to content

Commit 44921ae

Browse files
committed
doc: README and example
1 parent 00eabeb commit 44921ae

File tree

4 files changed

+122
-6
lines changed

4 files changed

+122
-6
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
# Contributing Guidelines
22

3-
Contributions to this package are most welcome!
4-
5-
There is a test site in the solution to make working with this repository easier.
3+
Contributions to this image are most welcome!

.github/README.md

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,72 @@
1-
# caddy-docker-proxy-cloudflare
1+
# caddy-docker-proxy-cloudflare
2+
3+
[![Docker Image Version](https://img.shields.io/docker/v/jcdcdev/caddy-docker-proxy-cloudflare/latest)](https://hub.docker.com/r/jcdcdev/caddy-docker-proxy-cloudflare)
4+
[![Docker Image Size](https://img.shields.io/docker/image-size/jcdcdev/caddy-docker-proxy-cloudflare/latest)](https://hub.docker.com/r/jcdcdev/caddy-docker-proxy-cloudflare)
5+
[![GitHub issues](https://img.shields.io/github/issues/jcdcdev/caddy-docker-proxy-cloudflare)](https://github.com/jcdcdev/caddy-docker-proxy-cloudflare/issues)
6+
[![GitHub last commit](https://img.shields.io/github/last-commit/jcdcdev/caddy-docker-proxy-cloudflare)](https://github.com/jcdcdev/caddy-docker-proxy-cloudflare/commits)
7+
[![GitHub license](https://img.shields.io/github/license/jcdcdev/caddy-docker-proxy-cloudflare?color=8AB803)](../LICENSE)
8+
9+
## Description
10+
11+
This is a Docker image for using Caddy as a reverse proxy for Docker containers, allowing you to easily expose multiple services on one or many domain names with automatic HTTPS encryption using Cloudflare.
12+
13+
The image is based on the official Caddy Docker image and includes the following plugins
14+
15+
- [caddy-dns/cloudflare](https://github.com/caddy-dns/cloudflare)
16+
- [caddy-docker-proxy](https://github.com/lucaslorentz/caddy-docker-proxy)
17+
18+
## Why?
19+
20+
I have a Raspberry pi running docker with many services and I want a clean way to get a https reverse proxy up and running _without_ opening port 80 to the world.
21+
22+
## Requirements
23+
24+
- Docker
25+
- A domain name
26+
- DNS must be managed by Cloudflare - [Guide](https://developers.cloudflare.com/dns/zone-setups/full-setup/setup/)
27+
- Cloudflare API key - [Guide](https://github.com/libdns/cloudflare#authenticating)
28+
29+
## Example Usage
30+
31+
Create a `docker-compose.yml` file with the following content:
32+
33+
```yml
34+
version: "3.3"
35+
networks:
36+
frontend:
37+
name: frontend
38+
services:
39+
# Caddy set up
40+
caddy:
41+
image: jcdcdev/caddy-docker-proxy-cloudflare:latest
42+
ports:
43+
- 80:80
44+
- 443:443
45+
networks:
46+
- frontend
47+
volumes:
48+
- /var/run/docker.sock:/var/run/docker.sock
49+
- '~/caddy/data:/data'
50+
labels:
51+
caddy: (cftls)
52+
caddy.tls.dns: cloudflare "API-KEY-HERE"
53+
caddy.tls.resolvers: 1.1.1.1
54+
# Container that uses Caddy
55+
who:
56+
image: traefik/whoami
57+
networks:
58+
- frontend
59+
labels:
60+
caddy: who-am-i.my-domain.com
61+
caddy.reverse_proxy: "{{upstreams 80}}"
62+
caddy.import: cftls
63+
```
64+
65+
## Contributing
66+
67+
Contributions to this image are most welcome! Please read the [Contributing Guidelines](CONTRIBUTING.md).
68+
69+
## Acknowledgments (thanks!)
70+
71+
- lucaslorentz - [caddy-docker-proxy](https://github.com/lucaslorentz/caddy-docker-proxy)
72+
- caddy-dns - [caddy-dns/cloudflare](https://github.com/caddy-dns/cloudflare)

.github/workflows/template.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ jobs:
7676
push: ${{ inputs.deploy == true }}
7777
build-args: |
7878
BUILD_VERSION=${{ env.SEMVER }}
79-
# cache-from: type=gha
80-
# cache-to: type=gha,mode=max
79+
cache-from: type=gha
80+
cache-to: type=gha,mode=max
8181
platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6
8282
create-release:
8383
name: 🚀 create release

docs/examples/docker-compose.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
version: "3.3"
2+
networks:
3+
frontend:
4+
name: frontend
5+
services:
6+
# Caddy set up
7+
caddy:
8+
image: jcdcdev/caddy-docker-proxy-cloudflare:latest
9+
ports:
10+
- 80:80
11+
- 443:443
12+
networks:
13+
- frontend
14+
volumes:
15+
- /var/run/docker.sock:/var/run/docker.sock
16+
- '~/caddy/data:/data'
17+
labels:
18+
caddy: (cftls)
19+
caddy.tls.dns: cloudflare "API-KEY-HERE"
20+
caddy.tls.resolvers: 1.1.1.1
21+
# Container that uses Caddy
22+
who:
23+
image: traefik/whoami
24+
networks:
25+
- frontend
26+
labels:
27+
caddy: who.example.com
28+
caddy.reverse_proxy: "{{upstreams 80}}"
29+
caddy.import: cftls
30+
# Container that uses Caddy
31+
am:
32+
image: traefik/whoami
33+
networks:
34+
- frontend
35+
labels:
36+
caddy: am.example.com
37+
caddy.reverse_proxy: "{{upstreams 80}}"
38+
caddy.import: cftls
39+
# Container that uses Caddy
40+
i:
41+
image: traefik/whoami
42+
networks:
43+
- frontend
44+
labels:
45+
caddy: i.example.com
46+
caddy.reverse_proxy: "{{upstreams 80}}"
47+
caddy.import: cftls

0 commit comments

Comments
 (0)