Git Product home page Git Product logo

Comments (3)

jkhartshorne avatar jkhartshorne commented on July 29, 2024

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.

Steveb-p avatar Steveb-p commented on July 29, 2024

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.

jkhartshorne avatar jkhartshorne commented on July 29, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.