From ba668e486f5fc8062023dc533eb508f4912606c8 Mon Sep 17 00:00:00 2001 From: Mikko Rantanen Date: Fri, 15 Aug 2025 15:02:30 +0300 Subject: [PATCH 1/2] docs: content is not valid for volumes, replace example with configs instead --- docs/knowledge-base/docker/compose.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/knowledge-base/docker/compose.md b/docs/knowledge-base/docker/compose.md index 6bf697e0..f922d109 100644 --- a/docs/knowledge-base/docker/compose.md +++ b/docs/knowledge-base/docker/compose.md @@ -97,16 +97,18 @@ services: image: filebrowser/filebrowser:latest environment: - POSTGRES_PASSWORD=password - volumes: - - type: bind - source: ./srv/99-roles.sql + configs: + - source: roles target: /docker-entrypoint-initdb.d/init-scripts/99-roles.sql - content: | - -- NOTE: change to your own passwords for production environments - \set pgpass `echo "$POSTGRES_PASSWORD"` - ALTER USER authenticator WITH PASSWORD :'pgpass'; - ALTER USER pgbouncer WITH PASSWORD :'pgpass'; +configs: + roles: + content: | + -- NOTE: change to your own passwords for production environments + \set pgpass `echo "$POSTGRES_PASSWORD"` + + ALTER USER authenticator WITH PASSWORD :'pgpass'; + ALTER USER pgbouncer WITH PASSWORD :'pgpass'; ``` ## Exclude from healthchecks @@ -163,4 +165,4 @@ labels: - traefik.enable=true - "traefik.http.routers..rule=Host(`coolify.io`) && PathPrefix(`/`)" - traefik.http.routers..entryPoints=http -``` \ No newline at end of file +``` From f818cb3456cbfe6c2152be8b4fd0d60f53619c1c Mon Sep 17 00:00:00 2001 From: Mikko Rantanen Date: Tue, 19 Aug 2025 06:19:56 +0300 Subject: [PATCH 2/2] docs: add configs example in addition to existing file with content --- docs/knowledge-base/docker/compose.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/knowledge-base/docker/compose.md b/docs/knowledge-base/docker/compose.md index f922d109..d799836f 100644 --- a/docs/knowledge-base/docker/compose.md +++ b/docs/knowledge-base/docker/compose.md @@ -91,6 +91,26 @@ services: Here you can see how to add a file with content and a dynamic value that is coming from an environment variable. +```yaml +services: + filebrowser: + image: filebrowser/filebrowser:latest + environment: + - POSTGRES_PASSWORD=password + volumes: + - type: bind + source: ./srv/99-roles.sql + target: /docker-entrypoint-initdb.d/init-scripts/99-roles.sql + content: | # This will tell Coolify to create the file (this is not available in a normal docker-compose) + -- NOTE: change to your own passwords for production environments + \set pgpass `echo "$POSTGRES_PASSWORD"` + + ALTER USER authenticator WITH PASSWORD :'pgpass'; + ALTER USER pgbouncer WITH PASSWORD :'pgpass'; +``` + +Alternatively config files can be created using the [configs](https://docs.docker.com/reference/compose-file/configs/) top level element in Docker Compose. + ```yaml services: filebrowser: