Skip to content

PR #494 broke Docker startup with ENTRYPOINT ["symfony", "server:start", "--no-tls", "--port=80"] #523

@powernic

Description

@powernic

The recent pull request #494, which changes the default behavior to only listen on 127.0.0.1, has caused issues when running Symfony CLI in a Docker container. Specifically, the following ENTRYPOINT command no longer works as expected:

ENTRYPOINT ["symfony", "server:start", "--no-tls", "--port=80"]

Steps to Reproduce:

Create a Dockerfile with the following content:

FROM php:8.2-fpm-alpine3.17
RUN   curl -s https://get.symfony.com/cli/installer | bash \
	&& mv /root/.symfony5/bin/symfony /usr/local/bin/symfony
WORKDIR /var/www/html
ENTRYPOINT ["symfony", "server:start", "--no-tls", "--port=80"]

Build and run the Docker container.
Attempt to access the Symfony server from outside the container.

Expected Behavior:

The Symfony server should be accessible from outside the Docker container. Actual Behavior: The server is not accessible because it only listens on 127.0.0.1.

Proposed Solution:

Allow specifying the address to listen on via an environment variable or command-line option, or revert the default behavior to listen on all addresses (0.0.0.0).

Additional Context:

This issue affects users who rely on Docker for their development and deployment workflows. The change in default behavior has introduced a breaking change for these users.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions