-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker Compose instructions and Docker build workflow
- Loading branch information
Showing
13 changed files
with
136 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: ci | ||
|
||
on: | ||
push: | ||
branches: ["main"] | ||
tags: ["v*.*.*"] | ||
|
||
jobs: | ||
docker: | ||
environment: Docker Build | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Collect Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
${{ vars.DOCKERHUB_USERNAME }}/sandhole | ||
tags: | | ||
type=ref,event=branch | ||
type=sha | ||
type=semver,pattern={{version}} | ||
type=semver,pattern={{major}}.{{minor}} | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
- name: Login to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ vars.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_PUSH_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v6 | ||
with: | ||
push: true | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,12 @@ license = "MIT" | |
authors = ["Eric Rodrigues Pires <[email protected]>"] | ||
readme = "README.md" | ||
categories = ["network-programming", "web-programming", "authentication"] | ||
exclude = [ | ||
".github", | ||
"book", | ||
"docker-compose-example", | ||
"tests", | ||
] | ||
|
||
[dependencies] | ||
anyhow = "1.0.93" | ||
|
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Using Docker Compose | ||
|
||
The most straightforward way to have Sandhole up and running is with Docker Compose. Mainly, this takes care of running dnsrobocert for you, and daemonizes your application. | ||
|
||
An example is provided in [docker-compose-example](https://github.com/EpicEric/sandhole/tree/main/docker-compose-example), using `server.com` as the example domain and Hetzner as the DNS provider for DNS-01 challenges in `le-config.yml`. | ||
|
||
Adjust the fields and CLI flags as appropriate for your use-case. Then, simply run: | ||
|
||
```shell | ||
docker compose up -d | ||
``` | ||
|
||
Then, if you need to restart the service: | ||
|
||
```shell | ||
docker compose restart | ||
``` | ||
|
||
Or stop it entirely: | ||
|
||
```shell | ||
docker compose down | ||
``` |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
deploy/ | ||
letsencrypt/ |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
services: | ||
letsencrypt: | ||
image: docker.io/adferrand/dnsrobocert:3.25.0 | ||
container_name: sandhole_dnsrobocert | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
- ./letsencrypt:/etc/letsencrypt | ||
- ./le-config.yml:/etc/dnsrobocert/config.yml | ||
restart: unless-stopped | ||
|
||
sandhole: | ||
image: docker.io/epiceric/sandhole:latest | ||
container_name: sandhole | ||
depends_on: | ||
- letsencrypt | ||
volumes: | ||
- ./letsencrypt:/letsencrypt | ||
- ./deploy:/deploy | ||
# See https://epiceric.github.io/sandhole/cli.html | ||
command: | | ||
--domain=server.com | ||
--user-keys-directory=/deploy/user_keys/ | ||
--admin-keys-directory=/deploy/admin_keys/ | ||
--certificates-directory=/letsencrypt/live/ | ||
--acme-cache-directory=/deploy/acme_cache/ | ||
--private-key-file=/deploy/server_keys/ssh | ||
--ssh-port=2222 | ||
--http-port=80 | ||
--https-port=443 | ||
--force-https | ||
[email protected] | ||
network_mode: host | ||
restart: unless-stopped |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
acme: | ||
email_account: [email protected] | ||
certificates: | ||
- domains: | ||
- server.com | ||
- "*.server.com" | ||
name: server.com | ||
profile: hetzner | ||
profiles: | ||
- name: hetzner | ||
provider: hetzner | ||
provider_options: | ||
auth_token: "" # Add PAT for Hetzner DNS |
This file contains 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
This file contains 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