You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docker-compose.dev.yml is definitely not a standard name for configuration file. This library doesn't do anything fancy with configuration files and relies on normal execution of docker-compose binary.
This means that by default docker-compose.y[a]ml and docker-compose.override.y[a]ml files are loaded, just as the docker-compose docs say.
Sure. But for various reasons, I needed to run this command not from the directory where the yaml is. In any case, it turns out that compose.exe() will take options to use a different location and name. It's just not documented. Also, it looks like the documentation on how to specify the command itself is at the very least incomplete, but probably outright wrong. (The one example shows the command presented as a single string, whereas I could only get it to work as an an array of strings.)
I'm having difficulty using compose.exec. Part of this is because I think the docs are wrong. Here's what docs say:
exec(container, command, options)
However, you definitely have to include information about the docker-compose.yaml. This at least runs:
compose.exec('test_db',
psql, {cwd: path.join(initDir, 'pushkin'), config: 'docker-compose.dev.yml'}, '-U postgres',
-c 'create database test_db')
However, I get the following error:
'psql: FATAL: role "root" does not exist\n'
So it looks like the -U tag is being ignored. I also tried doing it this way:
compose.exec('test_db',
psql -U postgres -c 'create database test_db', {cwd: path.join(initDir, 'pushkin'), config: 'docker-compose.dev.yml'})
with the same result. Here's the critical part of my docker-compose:
Since I didn't set a root user, docker goes with the default 'postgres'. However, trying to set the user to 'root' didn't help:
The text was updated successfully, but these errors were encountered: