Compare commits
5 Commits
beb4088c51
...
main
Author | SHA1 | Date | |
---|---|---|---|
a05fcb8ade
|
|||
6313bc5ec7
|
|||
21abbe97ed
|
|||
6582a72b43
|
|||
86085039ff
|
1
.gitignore
vendored
1
.gitignore
vendored
@@ -2,3 +2,4 @@
|
|||||||
/config/traefik/dynamic/*
|
/config/traefik/dynamic/*
|
||||||
!/config/traefik/dynamic/ssl.yaml
|
!/config/traefik/dynamic/ssl.yaml
|
||||||
!/config/traefik/dynamic/dashboard.yaml
|
!/config/traefik/dynamic/dashboard.yaml
|
||||||
|
services/
|
||||||
|
17
README.md
17
README.md
@@ -1,5 +1,5 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<img src="https://git.max-richter.dev/attachments/91cbb502-e4e1-4861-ad56-efc8f1d11e0a" width="30%"/>
|
<img src="https://git.max-richter.dev/attachments/3cea8ffa-57cc-4faf-a973-7a3b34a012e0" width="30%"/>
|
||||||
<h2 align="center">LocalCerts</h2>
|
<h2 align="center">LocalCerts</h2>
|
||||||
<p align="center">
|
<p align="center">
|
||||||
Automatic HTTPS and local domain routing for Docker Compose services using <a href="https://github.com/traefik/traefik">Traefik</a>, <a href="https://github.com/mageddo/dns-proxy-server">DPS</a> and <a href="https://github.com/smallstep/certificates">Step-CA</a>.
|
Automatic HTTPS and local domain routing for Docker Compose services using <a href="https://github.com/traefik/traefik">Traefik</a>, <a href="https://github.com/mageddo/dns-proxy-server">DPS</a> and <a href="https://github.com/smallstep/certificates">Step-CA</a>.
|
||||||
@@ -116,21 +116,24 @@ docker compose exec step step ca provisioner update acme \
|
|||||||
--x509-default-dur=2160h
|
--x509-default-dur=2160h
|
||||||
```
|
```
|
||||||
|
|
||||||
### Use the preconfigured services
|
### Create a shell script to start/stop general services
|
||||||
|
|
||||||
|
I often use tools like dbgate to interact with databases. For such utilities, I maintain a services/compose.yml file in this directory, where each service is defined with a custom profile. This setup allows me to start and stop individual services as needed.
|
||||||
|
|
||||||
|
If you use the preconfigured services, you can add the following snippet to you `.bashrc`/`.zshrc` to easily start, stop, and manage the services. Make sure to update the `PROJECT_DIR` variable to point to the correct directory.
|
||||||
|
|
||||||
If you use the preconfigured services, you can add the following snippet to you `.bashrc`/`.zshrc` to easily start, stop, and manage the services.
|
|
||||||
```shell
|
```shell
|
||||||
dev () {
|
dev () {
|
||||||
PROJECT_DIR="$HOME/Projects/dev/services"
|
PROJECT_DIR="$HOME/Projects/dev/services"
|
||||||
case "$1" in
|
case "$1" in
|
||||||
(start) shift
|
(start) shift
|
||||||
docker compose -f "$PROJECT_DIR/docker-compose.yml" --profile "$@" up -d ;;
|
docker compose -f "$PROJECT_DIR/compose.yml" --profile "$@" up -d ;;
|
||||||
(restart) shift
|
(restart) shift
|
||||||
docker compose -f "$PROJECT_DIR/docker-compose.yml" --profile "$@" restart ;;
|
docker compose -f "$PROJECT_DIR/compose.yml" --profile "$@" restart ;;
|
||||||
(stop) shift
|
(stop) shift
|
||||||
docker compose -f "$PROJECT_DIR/docker-compose.yml" --profile "$@" down --remove-orphans ;;
|
docker compose -f "$PROJECT_DIR/compose.yml" --profile "$@" down --remove-orphans ;;
|
||||||
(logs) shift
|
(logs) shift
|
||||||
docker compose -f "$PROJECT_DIR/docker-compose.yml" --profile "$@" logs -f ;;
|
docker compose -f "$PROJECT_DIR/compose.yml" --profile "$@" logs -f ;;
|
||||||
(*) echo "Usage: dev {start|restart|stop|logs} [services...]" ;;
|
(*) echo "Usage: dev {start|restart|stop|logs} [services...]" ;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
|
6
compose.override.example.yml
Normal file
6
compose.override.example.yml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
services:
|
||||||
|
dns:
|
||||||
|
volumes:
|
||||||
|
- /etc:/host/etc
|
||||||
|
environment:
|
||||||
|
MG_RESOLVCONF: /host/etc/resolv.conf
|
@@ -19,7 +19,7 @@ services:
|
|||||||
ipv4_address: 172.157.5.249
|
ipv4_address: 172.157.5.249
|
||||||
|
|
||||||
traefik:
|
traefik:
|
||||||
image: traefik:3.3
|
image: traefik:3.4.1
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
volumes:
|
volumes:
|
||||||
- /var/run/docker.sock:/var/run/docker.sock
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
0
services/.gitignore
vendored
0
services/.gitignore
vendored
@@ -1,67 +0,0 @@
|
|||||||
services:
|
|
||||||
mailpit:
|
|
||||||
profiles:
|
|
||||||
- mail
|
|
||||||
image: axllent/mailpit
|
|
||||||
ports:
|
|
||||||
- 1025:1025
|
|
||||||
environment:
|
|
||||||
MP_UI_BIND_ADDR: "0.0.0.0:8085"
|
|
||||||
labels:
|
|
||||||
serviceName: mail
|
|
||||||
traefik.http.services.mail.loadbalancer.server.port: 8085
|
|
||||||
|
|
||||||
datasette:
|
|
||||||
ports:
|
|
||||||
- 8001:8001
|
|
||||||
volumes:
|
|
||||||
- datasette:/mnt
|
|
||||||
image: datasetteproject/datasette
|
|
||||||
command: datasette -p 8001 -h 0.0.0.0 --plugins-dir=/mnt/plugins/ --config default_page_size:500 /mnt/data/qs-monitor-usage.db
|
|
||||||
profiles:
|
|
||||||
- data
|
|
||||||
labels:
|
|
||||||
serviceName: data
|
|
||||||
traefik.http.services.data.loadbalancer.server.port: 8001
|
|
||||||
|
|
||||||
silverbullet:
|
|
||||||
profiles:
|
|
||||||
- notes
|
|
||||||
image: ghcr.io/silverbulletmd/silverbullet:v2
|
|
||||||
volumes:
|
|
||||||
- ~/Notes:/space
|
|
||||||
labels:
|
|
||||||
serviceName: notes
|
|
||||||
|
|
||||||
db:
|
|
||||||
profiles:
|
|
||||||
- db
|
|
||||||
build: docker
|
|
||||||
image: dbgate/dbgate:beta-alpine
|
|
||||||
labels:
|
|
||||||
serviceName: db
|
|
||||||
volumes:
|
|
||||||
- dbgate:/root/.dbgate
|
|
||||||
|
|
||||||
grafana:
|
|
||||||
profiles:
|
|
||||||
- logs
|
|
||||||
image: grafana/grafana:11.2.0
|
|
||||||
environment:
|
|
||||||
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
|
|
||||||
- GF_AUTH_ANONYMOUS_ENABLED=true
|
|
||||||
- GF_AUTH_BASIC_ENABLED=false
|
|
||||||
- GF_FEATURE_TOGGLES_ENABLE=accessControlOnCall lokiLogsDataplane exploreLogsShardSplitting
|
|
||||||
- GF_PLUGINS_PREINSTALL_DISABLED=true
|
|
||||||
- GF_INSTALL_PLUGINS=https://storage.googleapis.com/integration-artifacts/grafana-lokiexplore-app/grafana-lokiexplore-app-latest.zip;grafana-lokiexplore-app
|
|
||||||
labels:
|
|
||||||
serviceName: grafana
|
|
||||||
volumes:
|
|
||||||
- ./provisioning/grafana:/etc/grafana/provisioning
|
|
||||||
extra_hosts:
|
|
||||||
- 'host.docker.internal:host-gateway'
|
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
|
||||||
dbgate: ~
|
|
||||||
datasette: ~
|
|
@@ -1,8 +0,0 @@
|
|||||||
apiVersion: 1
|
|
||||||
|
|
||||||
datasources:
|
|
||||||
- name: gdev-loki
|
|
||||||
type: loki
|
|
||||||
uid: gdev-loki
|
|
||||||
access: proxy
|
|
||||||
url: http://host.docker.internal:3100
|
|
@@ -1,12 +0,0 @@
|
|||||||
apiVersion: 1
|
|
||||||
|
|
||||||
apps:
|
|
||||||
- type: "grafana-lokiexplore-app"
|
|
||||||
org_id: 1
|
|
||||||
org_name: "Grafana"
|
|
||||||
disabled: false
|
|
||||||
jsonData:
|
|
||||||
apiUrl: http://default-url.com
|
|
||||||
isApiKeySet: true
|
|
||||||
secureJsonData:
|
|
||||||
apiKey: secret-key
|
|
Reference in New Issue
Block a user