Skip to content

Environment variables interpolation not supported #140

Open

Description

@TheDogHusky

Hey!

Just got my macbook pro, and decided to code my stuff on it with container compose.
The biggest issueI just came across is variable interpolation.

Here is the file:

services:
    redis:
        image: redis:7-alpine
        container_name: victoria-redis
        ports:
            - "6379:6379"
        command: ["redis-server", "--requirepass", "${REDIS_PASSWORD:-devpassword}"]
        env_file:
            - .env
        volumes:
            - redis_data:/data
        restart: unless-stopped

volumes:
    redis_data:

and .env:

REDIS_PASSWORD=mypassword

You would expect to be able to connect to redis://localhost:6379 with the password "mypassword" right?
Wrong! Unlike with docker, the password will be "${REDIS_PASSWORD:-devpassword} ", literally.

This has been a very annoying issue I came across.

Hoping it'll get fixed soon!

Cheers,
Adam

Activity

  1. TheDogHusky commented on Jul 23, 2026

    @TheDogHusky
    Author

    Seems like this pr fixes it

  2. Mcrich23 commented on Sep 9, 2026

    @Mcrich23
    Owner

    Sorry for the delay getting back to you. I wasn't able to work on open source for most of the summer. Command arguments currently aren't interpolated, which explains the literal password.

    #146 addresses this specific case; #102 doesn't cover command arguments. Once #146 lands, would you mind trying your Redis example again and letting me know whether it uses the expected password?

  3. TheDogHusky commented on Sep 9, 2026

    @TheDogHusky
    Author

    Of course, i'll be more than happy to try it out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions