change DB to Volume

This commit is contained in:
= 2025-08-01 10:20:38 +02:00
parent 3be638bfed
commit 5adc9284b4
2 changed files with 4 additions and 5 deletions

View file

@ -1,11 +1,9 @@
--- ---
- name: Ensure data directories exist - name: Ensure data directories exist
ansible.builtin.file: ansible.builtin.file:
path: "{{ container_base_dir }}/data/{{ item }}" path: "{{ container_base_dir }}/data"
state: directory state: directory
mode: '0755' mode: '0755'
loop:
- "db"
become: false become: false
- name: Deploy Docker Compose and .env files - name: Deploy Docker Compose and .env files

View file

@ -13,7 +13,7 @@ services:
- POSTGRES_NON_ROOT_USER=${N8N_POSTGRES_NON_ROOT_USER} - POSTGRES_NON_ROOT_USER=${N8N_POSTGRES_NON_ROOT_USER}
- POSTGRES_NON_ROOT_PASSWORD=${N8N_POSTGRES_NON_ROOT_PASSWORD} - POSTGRES_NON_ROOT_PASSWORD=${N8N_POSTGRES_NON_ROOT_PASSWORD}
volumes: volumes:
- ./data/db:/var/lib/postgresql/data - db:/var/lib/postgresql/data
- ./data/init-data.sh:/docker-entrypoint-initdb.d/init-data.sh - ./data/init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
healthcheck: healthcheck:
test: ['CMD-SHELL', 'pg_isready -h localhost -U ${N8N_POSTGRES_USER} -d ${N8N_POSTGRES_DB}'] test: ['CMD-SHELL', 'pg_isready -h localhost -U ${N8N_POSTGRES_USER} -d ${N8N_POSTGRES_DB}']
@ -72,4 +72,5 @@ networks:
driver: bridge driver: bridge
volumes: volumes:
data: data:
db: