Git Product home page Git Product logo

Comments (9)

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

I think the TypeScript typings need to be updated as well.

Forgot about it, fixed.

from docker-compose.

AlexZeitler avatar AlexZeitler commented on July 29, 2024

@Steveb-p Great suggestion - looking forward to your PR!

from docker-compose.

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

@AlexZeitler I've looked at the current API, and it does not correspond 1:1 to docker-compose commands. Do you have any particular preference towards naming?

I feel they should be split to 3 different commands?

from docker-compose.

AlexZeitler avatar AlexZeitler commented on July 29, 2024

from docker-compose.

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

What would you suggest (wrt naming/splitting)?

I've went with config, configServices & configVolumes, to roughly keep them "under the same namespace" and designated that they are related to configuration, not actually running containers.

Some code style (eslint) changes went along with the PR, hope you don't mind? I've got them configured automatically according to your project settings, and I didn't notice them until after PR was created ;)

Feel free to request any changes you like, obviously ;)

from docker-compose.

AlexZeitler avatar AlexZeitler commented on July 29, 2024

from docker-compose.

AlexZeitler avatar AlexZeitler commented on July 29, 2024

@Steveb-p I checked out your PR and I'm trying to understand (mostly because I haven't used config until now) the exact intention behind splitting config into three commands.

I tried this (I added commandOptions: ['--services'] to second config test) which also works to output just the services without volumes:

  const std = await compose.config({ 
    cwd: path.join(__dirname), 
    log: true, 
    config: 'docker-compose-42.yml', 
    commandOptions: ['--services'] 
  });

from docker-compose.

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

@Steveb-p I checked out your PR and I'm trying to understand (mostly because I haven't used config until now) the exact intention behind splitting config into three commands.

I was trying to follow upAll, upMany, upOne, buildAll, etc. That's my reasoning. From my point of view since "helper" functions existed already, then creating three different functions for practically different "queries" would simplify their use for little extra cost of maintaining them.

Should I merge them together and only add some information to docs regarding their additional, potential use?

EDIT: Also, from my experience, docker-compose config options cannot be mixed together, i.e. you cannot use --services, --volumes and --hash="*" in one call. --service call takes precendence from my testing, and --volumes takes precedence over --hash.
Order in which options are specified is irrelevant.

steveb-p@laptop:~/PhpstormProjects/app$ ./run.sh app config --volumes --services --hash="*"
Checking for presence of external network (app)
Network app does not exist. Creating...
Network app created successfully
Nginx-proxy container running. Checking if it is attached to global network for this instance
app-mongo
app-redis
app-telegraf
app-mysql
app-mongo-events
app-php
app
app-event-parser
app-app-health
app-event-getter
app-migration

steveb-p@laptop:~/PhpstormProjects/app$ ./run.sh app config --volumes --hash="*"
Checking for presence of external network (app)
Network app does not exist. Creating...
Network app created successfully
Nginx-proxy container running. Checking if it is attached to global network for this instance
db-data

steveb-p@laptop:~/PhpstormProjects/app$ ./run.sh app config --hash="*" --services
Checking for presence of external network (app)
Network app does not exist. Creating...
Network app created successfully
Nginx-proxy container running. Checking if it is attached to global network for this instance
app-mongo-events
app-mongo
app-redis
app-mysql
app-php
app
app-migration
app-app-health
app-event-getter
app-telegraf
app-event-parser

steveb-p@laptop:~/PhpstormProjects/app$ ./run.sh app config --hash="*"
Checking for presence of external network (app)
Network app does not exist. Creating...
Network app created successfully
Nginx-proxy container running. Checking if it is attached to global network for this instance
app-mongo-events 983d91d9ce29ce4740452c1f658ec3769abf5ade136c01a3c7486eb75c4d560e
app-mysql ca1ddb7b2000411be89e3288e401ce452a6e03a5da3454e8b48004abdcc2456f
app-redis 6294353200ae7ea68c27c766f6cf093792eb6c43d6b67e1d41b50b15c21663d5
app-mongo f425594061d9f77b16211b002cf5588230d5b1b842abbf2a44ee37ce60a82cea
app-event-parser 25d1bffadfbb03f79b1da501e900b543dde483fc664642216ff9688792161845
app-event-getter db502a854203fd4f34add0bb71d4582b08230e40d1c6a1cd3dad523a132871f0
app-app-health 192a83a9e1b65857ff98f3ade1ed757514c3a6997a5793d43d49789312f70dad
app-migration fa379fae35b3ae192f6613e666f1485a0d71ce5da60dfe3d1592d13d1641ef23
app-php a91f805a9887e91cb5cf98ad9b58854a0a55df890ab1ee8c5791a33bc6520181
app 03ef9018d626cac72aa1eb1ccf283c46f3e933e4f88ec045e34036085459e1b0
app-telegraf aea1335bbeb9271fa92f8aefa3baf385b4d7d96cfc8c7275a974fe1115ac6fb3

from docker-compose.

AlexZeitler avatar AlexZeitler commented on July 29, 2024

Ok, then splitting makes perfectly sense.

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.