Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Docker warning on start/stop/exec because of missing APP_PROJECT_DIR variable #62395

@mmarton

Description

@mmarton

Symfony version(s) affected

7.4.0-rc1

Description

Hi

after upgraded the new recipe for framework-bundle (https://github.com/symfony/recipes/blob/main/symfony/framework-bundle/7.4/manifest.json#L18)

I have APP_SHARE_DIR=$APP_PROJECT_DIR/var/share in my .env file

Every docker operation reads .env file by default and tries to parse it, and shows warnings:
https://docs.docker.com/compose/how-tos/environment-variables/variable-interpolation/#env-file

docker compose up -d
WARN[0000] The "APP_PROJECT_DIR" variable is not set. Defaulting to a blank string.

docker compose exec php bash
WARN[0000] The "APP_PROJECT_DIR" variable is not set. Defaulting to a blank string.

docker compose stop
WARN[0000] The "APP_PROJECT_DIR" variable is not set. Defaulting to a blank string.

etc...

How to reproduce

start symfony 7.4 in docker env

Possible Solution

No response

Additional Context

docker version
Client: Docker Engine - Community
Version: 29.0.0

docker compose version
Docker Compose version v2.40.3

.env:

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=
APP_SHARE_DIR=$APP_PROJECT_DIR/var/share
###< symfony/framework-bundle ###

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions