testcontainers / testcontainers/testcontainers-python
Feature: Allow setting environment variables with DockerCompose
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.3k
- Forks
- 386
- Avg merge
- 4h 40m
- Merged PRs (30d)
- 1
Description
What are you trying to do?
I would like to be able to build and run docker compose containers using environment variables not stored in an env file. We are trying to test spinning up n database containers where n is configurable. Each database has its own name and root credentials which are generated dynamically so we cannot hard code them in env files.
Why should it be done this way?
This enhancement would allow users to define the environment variables for a docker compose service at runtime. Gives the library more flexibility.
Other references:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the DockerCompose entry point and read Docker's Environment Variable Options reference linked in the issue, then trace how compose services and environment files are configured. Done means callers can provide runtime-generated variables for compose services, including dynamic database names and credentials, without requiring an env file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, docker-compose, python
- Domain
- infrastructure, testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100