localstack / localstack/serverless-localstack
Specify profile for docker compose in config
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 542
- Forks
- 92
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit nachzuverfolgen, wie das Plugin benutzerdefiniertes config.docker liest und den docker compose up-Befehl erstellt. Füge Unterstützung für einen optionalen profile- oder profiles-Wert hinzu und überprüfe dies mit einer Compose-Datei, die local- und test-Profile enthält, sodass nur das ausgewählte Profil gestartet wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- docker, docker-compose, javascript
- Bereich
- devops
- Issue-Typ
- Feature
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 50/100