store mastodon cache outside of backupable directory

This commit is contained in:
Pim Kunis 2023-01-11 00:19:14 +01:00
parent ecfb6b92f4
commit 898e9b1c16
2 changed files with 8 additions and 1 deletions

View file

@ -10,11 +10,16 @@
template: template:
src: "{{ role_path }}/templates/docker-compose.yml.j2" src: "{{ role_path }}/templates/docker-compose.yml.j2"
dest: "{{ service_dir }}/docker-compose.yml" dest: "{{ service_dir }}/docker-compose.yml"
- name: Create Mastodon data directory - name: Create data directory
file: file:
path: "{{ data_dir }}" path: "{{ data_dir }}"
state: directory state: directory
mode: 0777 mode: 0777
- name: Create cache directory
file:
path: "{{ service_dir }}/cache"
state: directory
mode: 0777
- name: Start Docker Compose - name: Start Docker Compose
docker_compose: docker_compose:
project_src: "{{ service_dir }}" project_src: "{{ service_dir }}"

View file

@ -50,6 +50,7 @@ services:
- redis - redis
volumes: volumes:
- {{ data_dir }}/public/system:/mastodon/public/system - {{ data_dir }}/public/system:/mastodon/public/system
- {{ service_dir }}/cache:/mastodon/public/system/cache
labels: labels:
- traefik.http.routers.mastodon.entrypoints=websecure - traefik.http.routers.mastodon.entrypoints=websecure
- traefik.http.routers.mastodon.rule=Host(`social.pizzapim.nl`) - traefik.http.routers.mastodon.rule=Host(`social.pizzapim.nl`)
@ -97,6 +98,7 @@ services:
- default - default
volumes: volumes:
- {{ data_dir }}/public/system:/mastodon/public/system - {{ data_dir }}/public/system:/mastodon/public/system
- {{ service_dir }}/cache:/mastodon/public/system/cache
healthcheck: healthcheck:
test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"] test: ['CMD-SHELL', "ps aux | grep '[s]idekiq\ 6' || false"]