Skip to content

Commit 922c18e

Browse files
authored
docs(compose): add configs top-level element (#340)
1 parent f967ac2 commit 922c18e

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

docs/knowledge-base/docker/compose.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,14 +250,36 @@ services:
250250
- type: bind
251251
source: ./srv/99-roles.sql
252252
target: /docker-entrypoint-initdb.d/init-scripts/99-roles.sql
253-
content: |
253+
content: | # This will tell Coolify to create the file (this is not available in a normal docker-compose)
254254
-- NOTE: change to your own passwords for production environments
255255
\set pgpass `echo "$POSTGRES_PASSWORD"`
256256
257257
ALTER USER authenticator WITH PASSWORD :'pgpass';
258258
ALTER USER pgbouncer WITH PASSWORD :'pgpass';
259259
```
260260
261+
Alternatively config files can be created using the [configs](https://docs.docker.com/reference/compose-file/configs/) top level element in Docker Compose.
262+
263+
```yaml
264+
services:
265+
filebrowser:
266+
image: filebrowser/filebrowser:latest
267+
environment:
268+
- POSTGRES_PASSWORD=password
269+
configs:
270+
- source: roles
271+
target: /docker-entrypoint-initdb.d/init-scripts/99-roles.sql
272+
273+
configs:
274+
roles:
275+
content: |
276+
-- NOTE: change to your own passwords for production environments
277+
\set pgpass `echo "$POSTGRES_PASSWORD"`
278+
279+
ALTER USER authenticator WITH PASSWORD :'pgpass';
280+
ALTER USER pgbouncer WITH PASSWORD :'pgpass';
281+
```
282+
261283
## Exclude from healthchecks
262284
263285
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`.

0 commit comments

Comments
 (0)