Skip to content

Environment variables interpolation not supported #140

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

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