This .env to docker-compose converter parses a standard .env file and
generates both a ready-to-paste environment: block and a full single-service
docker-compose.yml skeleton. Everything runs client-side, which matters since
.env files often hold real secrets.
How to use it
Paste the contents of your .env file, optionally set a service name, and click Convert.
You'll get two outputs: just the environment: list (for pasting into an
existing compose file) and a complete skeleton with a placeholder image field, ready to
fill in.
What gets parsed
Each non-empty, non-comment line is split on its first =. A leading
export keyword is stripped (common when a .env file is also meant to be
sourced in a shell), and matching surrounding quotes around the value are removed.
Malformed lines without an = are skipped rather than breaking the whole
conversion.
Why list-style environment blocks
Docker Compose supports both a map (KEY: value) and a list
(- KEY=value) syntax for environment variables. This tool outputs list style
because it handles values containing colons — like URLs and connection strings — without
needing extra YAML quoting.