Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify profile for docker compose in config #265

Open
peetjvv opened this issue Sep 12, 2024 · 0 comments
Open

Specify profile for docker compose in config #265

peetjvv opened this issue Sep 12, 2024 · 0 comments
Labels
enhancement New feature or request status: backlog

Comments

@peetjvv
Copy link

peetjvv commented Sep 12, 2024

Problem

I have multiple profiles configured in my docker-compose.yml file. I would like to only run the containers tagged with a particular profile with via this plugin's docker compose up command.

Example

Example compose file:

# docker-compose.yml
services:
  localstack:
    profiles:
      - local
    container_name: '${LOCALSTACK_DOCKER_NAME:-localstack-main}'
    image: localstack/localstack
    ports:
      - 4566:4566 # LocalStack Gateway
      - 4510-4559:4510-4559 # external services port range
    environment:
      # LocalStack configuration: https://docs.localstack.cloud/references/configuration/
      - DEBUG=${DEBUG:-0}
    volumes:
      - '${LOCALSTACK_VOLUME_DIR:-./volume}:/var/lib/localstack'
      - '/var/run/docker.sock:/var/run/docker.sock'

  redis-local:
    profiles:
      - local
    image: redis:7.2.4-alpine
    ports:
      - 6379:6379
    command: redis-server --logLevel notice --requirepass pass

  redis-test:
    profiles:
      - test
    image: redis:7.2.4-alpine
    ports:
      - 6379:6379
    command: redis-server --logLevel notice --requirepass pass

And the compose up command:

docker compose --profile local up -f docker-compose.yml

Read more about compose profiles here.

When specifying the local profile it shouldn't create the redis-test container.

Suggested solution

Can add an optional parameter to config.docker to specify the profile(s) to be run in the docker compose up command.

e.g.

custom:
  localstack:
    docker:
      profiles:
       - local
@steffyP steffyP added enhancement New feature or request status: backlog labels Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request status: backlog
Projects
None yet
Development

No branches or pull requests

2 participants