Comments (3)
OK. I think this was a docs problem. The following seems to be working:
compose.exec('test_db', ['psql', '-U', 'postgres', '-c', 'create database test_db'], {cwd: path.join(initDir, 'pushkin'), config: 'docker-compose.dev.yml'})
with the following docker-compose:
test_db:
image: 'postgres:11'
environment:
POSTGRES_PASSWORD: example
from docker-compose.
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.
https://docs.docker.com/compose/extends/#understanding-multiple-compose-files
By default, Compose reads two files, a docker-compose.yml and an optional docker-compose.override.yml file.
from docker-compose.
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.)
from docker-compose.
Related Issues (20)
- Error running commands on Electron HOT 1
- Add a way to get progress report
- doubt docker-compose HOT 5
- Cannot create a string longer than 0x1fffffe8 characters HOT 9
- Error running docker-compose HOT 5
- adding a option to set COMPOSE_HTTP_TIMEOUT variable HOT 2
- spawn docker-compose ENOENT on Gitlab CI HOT 1
- rm and stopMany methods have an inconsistent API HOT 10
- How to use npm package docker-compose inside an active container? HOT 5
- ps doesn't output all services -> offset of 1 service HOT 1
- Output ends up in "err" instead of "out" on macos even when exitCode equals 0 HOT 8
- execCompose can throw "RangeError: Invalid string length" HOT 1
- Down options like downOne and downMany HOT 3
- Version 0.24.4 broke packages using that dependency HOT 1
- Support for docker compose watch HOT 3
- integration of list commands HOT 2
- passing env object causes issues HOT 2
- Improve detection if "--detach" should be set HOT 2
- Docker-Compose V2 && ESM + TypeScript HOT 4
- Throws: `Error: spawn docker-compose ENOENT` after updating docker to 4.32.0 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-compose.