diff --git a/docs/knowledge-base/docker/compose.md b/docs/knowledge-base/docker/compose.md index 6bf697e01..d799836fe 100644 --- a/docs/knowledge-base/docker/compose.md +++ b/docs/knowledge-base/docker/compose.md @@ -101,7 +101,7 @@ services: - type: bind source: ./srv/99-roles.sql target: /docker-entrypoint-initdb.d/init-scripts/99-roles.sql - content: | + 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"` @@ -109,6 +109,28 @@ services: 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: + image: filebrowser/filebrowser:latest + environment: + - POSTGRES_PASSWORD=password + configs: + - source: roles + target: /docker-entrypoint-initdb.d/init-scripts/99-roles.sql + +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 If you have a service that you do not want to be part of your overall healthchecks, you can exclude it from the healthchecks by setting the `exclude_from_hc` option to `true`. @@ -163,4 +185,4 @@ labels: - traefik.enable=true - "traefik.http.routers..rule=Host(`coolify.io`) && PathPrefix(`/`)" - traefik.http.routers..entryPoints=http -``` \ No newline at end of file +```