Compare commits

..

4 Commits

Author SHA1 Message Date
39920fd1e6 Modified README.md to include Memos example 2024-09-28 23:30:50 +02:00
2718e42ff8 Modified Caddyfile to include an example using Memos 2024-09-28 23:26:42 +02:00
27cd521a0f Minor mistake fix 2024-09-28 22:35:47 +02:00
60dcae71ef Added Memos 2024-09-28 22:35:07 +02:00
3 changed files with 62 additions and 1 deletions

View File

@ -12,7 +12,7 @@ Kubernetes has simply too much overhead for a small home lab like mine. I'm usin
The only thing that would make me change idea would be a need for autoscaling, but I'm still far from that situation.
### How do I use this?
The `caddy-docker-proxy` is the first container that should be started, after running `$ docker network create caddy` to ensure the external network exists on the system. The `Caddyfile` included and mounted in `/etc/caddy/caddyfile` is used in this case to give access to the air-gapped comtainers running on different machines on the same network.
The `caddy-docker-proxy` is the first container that should be started, after running `$ docker network create caddy` to ensure the external network exists on the system. The `Caddyfile` included and mounted in `/etc/caddy/Caddyfile` is used in this case to give access to the air-gapped comtainers running on different machines on the same network. An example is found in the [Caddyfile](https://gitea.oddone.dev/Doddophonique/compose-personal-stack/src/branch/caddy-revamp/caddy-docker-proxy/Caddyfile), where the [Memos](https://gitea.oddone.dev/Doddophonique/compose-personal-stack/src/branch/caddy-revamp/memos/docker-compose.yml) container is exposed.
As you can see, this is a borderline situation where some people may prefer having service discovery with either Swarm or Kubernetes, but in my experience this is still not enough to call for that.
### Conclusion (for now):

View File

@ -11,3 +11,11 @@ subdomain.domain.tld {
}
log
}
# This is an example based on the docker-compose.yml contained
# in the memos folder
memos.domain.tld {
reverse_proxy 192.168.1.128:9000
encode zstd gzip
log
}

53
memos/docker-compose.yml Normal file
View File

@ -0,0 +1,53 @@
---
x-logging:
&default-logging
driver: syslog
options:
tag: "container_name/{{.Name}}"
labels: "LABEL"
syslog-facility: local7
x-opt-values:
&volume-opt
driver_opts: &options
type: "nfs"
o: "addr=${IP},rw"
services:
memos:
image: neosmemo/memos:stable
container_name: memos
# Use labels if this container is hosted on the same machine as
# the Caddy reverse proxy
labels:
caddy: ${MEMOS_HOSTNAME}
caddy.log:
caddy.encode: "zstd gzip"
caddy.reverse_proxy: "{{upstreams 5230}}"
restart: unless-stopped
# This is not needed if labels are used. If this container is
# hosted on a different machine under the same subnetwoork, use
# its private IP address instead of 192.168.1.128. Check the
# Caddyfile inside caddy-docker-proxy folder for an example
# on how to forward traffic to this container
#
# ports:
# - "192.168.1.128:9000:5230"
volumes:
- /mnt/path:/var/opt/memos
networks:
- caddy
logging: *default-logging
# Optional, needed if you are using an NFS server
#
# volumes:
# volume:
# <<: *volume-opt
# driver_opts:
# <<: *options
# device: ":/mnt/path"
networks:
caddy:
external: true