env-docker/Config/ReverseProxy/docker-compose.micro.yml
Chad cf0d028a58
Nextcloud Purge Script, Hyperling.com Static Media Volume, Memory Tweaks (#19)
* Fix memory; was accidentally done in `docker-compose.yml`.

* Fix bad path.

* Prevent DB from crashing during `fixes.sh`.

* Bump the DB up a little more.

* Add photos directory.

* Log files as they copy.

* Increase certbot by a little, was maxing near 15MB after an image update.

* Add a HUGE space saver to the cleanup crew.

* Add the beginnings of a purge script. Helps try to bring down the DB size.

* Enhance output.

* Further enhance output.

* Fix loading of ENV.

* Enhance output. Purge file previews.

* Fix extra newline.

* Add sourcing of main ENV, use RM instead of MV to reduce steps.

* Fix rm command.

* Ensure maintenance mode is off when starting.

* Add volume rather than duplicating all media.

* Ignore media.

* Check space before as well.
2024-01-25 02:49:00 +00:00

44 lines
1.3 KiB
YAML

# 2022-10-05 Hyperling
# Reverse Proxy with LetsEncrypt Certbot.
# This is a revised version of these works:
# https://phoenixnap.com/kb/docker-nginx-reverse-proxy
# https://www.docker.com/blog/how-to-use-the-official-nginx-docker-image/
# https://pentacent.medium.com/nginx-and-lets-encrypt-with-docker-in-less-than-5-minutes-b4b8a60d3a71
version: '3'
services:
app:
container_name: rp-app
build: ./
restart: always
ports:
- "80:80"
- "443:443"
volumes:
- ../../Volumes/ReverseProxy/letsencrypt:/etc/nginx/letsencrypt
- ../../Volumes/ReverseProxy/letsencrypt-certs:/etc/nginx/certs
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
deploy:
mode: global
resources:
limits:
cpus: '0.20'
memory: 64M
certbot:
container_name: rp-certbot
image: certbot/certbot
restart: always
volumes:
- ../../Volumes/ReverseProxy/letsencrypt:/etc/letsencrypt
- ../../Volumes/ReverseProxy/letsencrypt-certs:/etc/letsencrypt/nginx
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; cp -rL /etc/letsencrypt/live/* /etc/letsencrypt/nginx/; sleep 12h & wait $${!}; done;'"
deploy:
mode: global
resources:
limits:
cpus: '0.10'
memory: 32M