Skip to content

APP_ENV variable defined in Dockerfile #736

@tcoch

Description

@tcoch

Hello @dunglas , Hello all,

I recently observed, through bug and debug, that the env variable APP_ENV is hardcoded in the Dockerfile.

So, for the production image, it automatically adds APP_ENV=prod, which is fine.

# Prod FrankenPHP image
FROM frankenphp_base AS frankenphp_prod

ENV APP_ENV=prod

However, in dev image, we have APP_ENV=dev :

# Dev FrankenPHP image
FROM frankenphp_base AS frankenphp_dev

ENV APP_ENV=dev XDEBUG_MODE=off

This env variable overrides the APP_ENV variable that is defined is my .env file in my Symfony project.
So, when using frankenphp_dev image, I'm bound to dev environment.

Problem is, I have a staging env that I created for my project. Which I cannot use, since I have APP_ENV=dev :(

Shouldn't we remove the APP_ENV definition ? At least in the frankenphp_dev image ?

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