Local script to Portainer configs

This commit is contained in:
Maksym Buz
2025-07-30 14:37:54 +02:00
committed by GitHub
parent e28d971882
commit 88f198a3da

View File

@@ -1,3 +1,6 @@
# This compose file uses configs for Portainer. Uncomment the local script lines if you want to use it.
# Comment out the configs section if you don't use Portainer.
services: services:
postgres: postgres:
image: postgres:16 image: postgres:16
@@ -11,7 +14,11 @@ services:
volumes: volumes:
# PostgreSQL will be stored in a local folder # PostgreSQL will be stored in a local folder
- ${PATH_TO_POSTGRES}:/var/lib/postgresql/data - ${PATH_TO_POSTGRES}:/var/lib/postgresql/data
- ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh # - ./init-data.sh:/docker-entrypoint-initdb.d/init-data.sh
configs:
- source: n8n_init_script
target: /docker-entrypoint-initdb.d/init-data.sh
mode: 0755 # Important: make the script executable
healthcheck: healthcheck:
test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}'] test: ['CMD-SHELL', 'pg_isready -h localhost -U ${POSTGRES_USER} -d ${POSTGRES_DB}']
interval: 5s interval: 5s