|
1 |
| - |
2 | 1 | # docker-caddy
|
3 | 2 |
|
4 | 3 | [Caddy](https://caddyserver.com/) in a docker container, configurable via a [simple web UI](https://github.com/jpillora/webproc)
|
|
12 | 11 |
|
13 | 12 | 1. Create a [`/opt/Caddyfile`](https://caddyserver.com/docs/caddyfile) file on the Docker host
|
14 | 13 |
|
15 |
| - ``` ini |
16 |
| - # Caddy config, for a more information, see: |
17 |
| - # https://caddyserver.com/docs/caddyfile |
18 |
| - :80 { |
19 |
| - gzip |
20 |
| - log stdout |
21 |
| - proxy / example.com |
22 |
| - } |
23 |
| - ``` |
| 14 | + ```ini |
| 15 | + # Caddy config, for a more information, see: |
| 16 | + # https://caddyserver.com/docs/caddyfile |
| 17 | + :80 { |
| 18 | + gzip |
| 19 | + log stdout |
| 20 | + proxy / example.com |
| 21 | + } |
| 22 | + ``` |
24 | 23 |
|
25 | 24 | 1. Run the container
|
26 | 25 |
|
27 |
| - ``` |
28 |
| - $ docker run \ |
29 |
| - --name caddy \ |
30 |
| - -d \ |
31 |
| - -p 58080:8080 \ |
32 |
| - -p 80:80 -p 443:443 \ |
33 |
| - -v /opt/Caddyfile:/etc/Caddyfile \ |
34 |
| - -v /opt/caddy:/root/.caddy \ |
35 |
| - --log-opt "max-size=100m" \ |
36 |
| - -e "USER=foo" \ |
37 |
| - -e "PASS=bar" \ |
38 |
| - --restart always \ |
39 |
| - jpillora/caddy |
40 |
| - ``` |
| 26 | + ``` |
| 27 | + $ docker run \ |
| 28 | + --name caddy \ |
| 29 | + -d \ |
| 30 | + -p 58080:8080 \ |
| 31 | + -p 80:80 -p 443:443 \ |
| 32 | + -v /opt/Caddyfile:/etc/Caddyfile \ |
| 33 | + -v /opt/caddy:/root/.caddy \ |
| 34 | + --log-opt "max-size=100m" \ |
| 35 | + -e "HTTP_USER=foo" \ |
| 36 | + -e "HTTP_PASS=bar" \ |
| 37 | + --restart always \ |
| 38 | + jpillora/caddy |
| 39 | + ``` |
41 | 40 |
|
42 | 41 | 1. Visit `http://<docker-host-ip>:58080`, authenticate with `foo/bar` and you should see
|
43 | 42 |
|
44 |
| -  |
45 |
| - |
| 43 | +  |
46 | 44 |
|
47 |
| -1. You now have an HTTP web server running at `http://<your-hostname>` |
| 45 | +1) You now have an HTTP web server running at `http://<your-hostname>` |
48 | 46 |
|
49 |
| -1. Using your DNS provider, create A record: `<docker-host-ip>` to `<your-hostname>` |
| 47 | +1) Using your DNS provider, create A record: `<docker-host-ip>` to `<your-hostname>` |
50 | 48 |
|
51 |
| -1. Change `:80` to `https://<your-hostname>:443`, and add a new line `tls <your-email>` above the `gzip` line, then **Restart** |
| 49 | +1) Change `:80` to `https://<your-hostname>:443`, and add a new line `tls <your-email>` above the `gzip` line, then **Restart** |
52 | 50 |
|
53 |
| -1. You now have an HTTPS web server running at `https://<your-hostname>` |
| 51 | +1) You now have an HTTPS web server running at `https://<your-hostname>` |
54 | 52 |
|
55 | 53 | Extras
|
56 | 54 |
|
57 |
| -* Bind the web UI to an internal IP address `-p <internal-ip>:58080:8080` and then it might be safe to remove `USER`/`PASS` |
| 55 | +- Bind the web UI to an internal IP address `-p <internal-ip>:58080:8080` and then it might be safe to remove `USER`/`PASS` |
58 | 56 |
|
59 | 57 | #### MIT License
|
60 | 58 |
|
|
0 commit comments