mirror of
https://github.com/bensuperpc/infrastructure.git
synced 2024-12-22 08:44:28 +01:00
Split volumes and add backup (WIP)
Signed-off-by: Bensuperpc <bensuperpc@gmail.com>
This commit is contained in:
parent
5e3b93ac20
commit
2eaaf1f936
13
Makefile
13
Makefile
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
DOCKER := docker
|
DOCKER := docker
|
||||||
|
|
||||||
PROFILES := webserver wordpress adminer uptime-kuma portainer qbittorrent gitea jellyfin watchtower
|
PROFILES := webserver wordpress adminer uptime-kuma portainer qbittorrent gitea jellyfin watchtower backup
|
||||||
PROFILE_CMD := $(addprefix --profile ,$(PROFILES))
|
PROFILE_CMD := $(addprefix --profile ,$(PROFILES))
|
||||||
|
|
||||||
COMPOSE_FILES := $(shell find docker-compose*.yml | sed -e 's/^/--file /')
|
COMPOSE_FILES := $(shell find docker-compose*.yml | sed -e 's/^/--file /')
|
||||||
@ -56,11 +56,14 @@ state:
|
|||||||
docker compose $(COMPOSE_FILES) ps
|
docker compose $(COMPOSE_FILES) ps
|
||||||
docker compose $(COMPOSE_FILES) top
|
docker compose $(COMPOSE_FILES) top
|
||||||
|
|
||||||
.PHONY: update
|
.PHONY: update-docker
|
||||||
update:
|
update-docker:
|
||||||
docker compose $(COMPOSE_FILES) $(PROFILE_CMD) pull
|
docker compose $(COMPOSE_FILES) $(PROFILE_CMD) pull
|
||||||
git submodule update --init --recursive --remote
|
|
||||||
git pull --recurse-submodules --all --progress
|
.PHONY: update
|
||||||
|
update: update-docker
|
||||||
|
# git submodule update --init --recursive --remote
|
||||||
|
# git pull --recurse-submodules --all --progress
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean:
|
clean:
|
||||||
|
25
docker-compose.backup.yml
Normal file
25
docker-compose.backup.yml
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
version: '3.9'
|
||||||
|
|
||||||
|
services:
|
||||||
|
# Backup
|
||||||
|
backup:
|
||||||
|
image: offen/docker-volume-backup:latest
|
||||||
|
container_name: backup
|
||||||
|
profiles:
|
||||||
|
- backup
|
||||||
|
restart: on-failure
|
||||||
|
env_file:
|
||||||
|
- env/backup.env
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||||
|
- caddy_data:/backup/caddy_data:ro
|
||||||
|
- caddy_config:/backup/caddy_config:ro
|
||||||
|
- backup:/archive
|
||||||
|
networks:
|
||||||
|
- infra-network
|
||||||
|
security_opt:
|
||||||
|
- no-new-privileges:true
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
backup:
|
||||||
|
name: backup
|
@ -30,3 +30,8 @@ services:
|
|||||||
# - SETUID
|
# - SETUID
|
||||||
# - NET_BIND_SERVICE
|
# - NET_BIND_SERVICE
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
caddy_data:
|
||||||
|
name: caddy_data
|
||||||
|
caddy_config:
|
||||||
|
name: caddy_config
|
||||||
|
@ -41,3 +41,11 @@ services:
|
|||||||
- infra-network
|
- infra-network
|
||||||
security_opt:
|
security_opt:
|
||||||
- no-new-privileges:true
|
- no-new-privileges:true
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
gitea_data:
|
||||||
|
name: gitea_data
|
||||||
|
gitea_config:
|
||||||
|
name: gitea_config
|
||||||
|
gitea_db:
|
||||||
|
name: gitea_db
|
||||||
|
@ -18,3 +18,11 @@ services:
|
|||||||
- infra-network
|
- infra-network
|
||||||
security_opt:
|
security_opt:
|
||||||
- no-new-privileges:true
|
- no-new-privileges:true
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
jellyfin_config:
|
||||||
|
name: jellyfin_config
|
||||||
|
jellyfin_data:
|
||||||
|
name: jellyfin_data
|
||||||
|
jellyfin_cache:
|
||||||
|
name: jellyfin_cache
|
@ -19,3 +19,9 @@ services:
|
|||||||
- infra-network
|
- infra-network
|
||||||
security_opt:
|
security_opt:
|
||||||
- no-new-privileges:true
|
- no-new-privileges:true
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
qbittorrent_config:
|
||||||
|
name: qbittorrent_config
|
||||||
|
qbittorrent_data:
|
||||||
|
name: qbittorrent_data
|
@ -1,29 +1,5 @@
|
|||||||
version: '3.9'
|
version: '3.9'
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
database:
|
|
||||||
name: database
|
|
||||||
wordpress:
|
|
||||||
name: wordpress
|
|
||||||
caddy_data:
|
|
||||||
name: caddy_data
|
|
||||||
caddy_config:
|
|
||||||
name: caddy_config
|
|
||||||
qbittorrent_config:
|
|
||||||
name: qbittorrent_config
|
|
||||||
qbittorrent_data:
|
|
||||||
name: qbittorrent_data
|
|
||||||
uptimekuma_data:
|
uptimekuma_data:
|
||||||
name: uptimekuma_data
|
name: uptimekuma_data
|
||||||
gitea_data:
|
|
||||||
name: gitea_data
|
|
||||||
gitea_config:
|
|
||||||
name: gitea_config
|
|
||||||
gitea_db:
|
|
||||||
name: gitea_db
|
|
||||||
jellyfin_config:
|
|
||||||
name: jellyfin_config
|
|
||||||
jellyfin_data:
|
|
||||||
name: jellyfin_data
|
|
||||||
jellyfin_cache:
|
|
||||||
name: jellyfin_cache
|
|
||||||
|
@ -21,23 +21,6 @@ services:
|
|||||||
security_opt:
|
security_opt:
|
||||||
- no-new-privileges:true
|
- no-new-privileges:true
|
||||||
|
|
||||||
# Adminer
|
|
||||||
adminer:
|
|
||||||
image: adminer:latest
|
|
||||||
container_name: adminer
|
|
||||||
profiles:
|
|
||||||
- adminer
|
|
||||||
restart: on-failure
|
|
||||||
env_file:
|
|
||||||
- env/adminer.env
|
|
||||||
depends_on:
|
|
||||||
- wordpress_db
|
|
||||||
- caddy
|
|
||||||
networks:
|
|
||||||
- infra-network
|
|
||||||
security_opt:
|
|
||||||
- no-new-privileges:true
|
|
||||||
|
|
||||||
# Database wordpress
|
# Database wordpress
|
||||||
wordpress_db:
|
wordpress_db:
|
||||||
image: mariadb:latest
|
image: mariadb:latest
|
||||||
@ -57,3 +40,26 @@ services:
|
|||||||
- infra-network
|
- infra-network
|
||||||
security_opt:
|
security_opt:
|
||||||
- no-new-privileges:true
|
- no-new-privileges:true
|
||||||
|
|
||||||
|
# Adminer
|
||||||
|
adminer:
|
||||||
|
image: adminer:latest
|
||||||
|
container_name: adminer
|
||||||
|
profiles:
|
||||||
|
- adminer
|
||||||
|
restart: on-failure
|
||||||
|
env_file:
|
||||||
|
- env/adminer.env
|
||||||
|
depends_on:
|
||||||
|
- wordpress_db
|
||||||
|
- caddy
|
||||||
|
networks:
|
||||||
|
- infra-network
|
||||||
|
security_opt:
|
||||||
|
- no-new-privileges:true
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
database:
|
||||||
|
name: database
|
||||||
|
wordpress:
|
||||||
|
name: wordpress
|
4
env/backup.env
vendored
Normal file
4
env/backup.env
vendored
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
BACKUP_COMPRESSION="zst"
|
||||||
|
BACKUP_CRON_EXPRESSION="0 2 * * *"
|
||||||
|
# BACKUP_RETENTION_DAYS: '7'
|
||||||
|
# BACKUP_FILENAME="backup-%Y-%m-%dT%H-%M-%S.{{ .Extension }}"
|
Loading…
Reference in New Issue
Block a user