DB_PORT was doing double duty - the container-internal port baked into
DATABASE_URL (must be 3306) and the host-published port in
docker-compose.yml. Setting it to 3306 for the URL made compose try to
publish host :3306, which collides with another stack's MySQL.
DATABASE_URL now hardcodes database:3306 (always correct inside the
compose network); the host publish uses ${DB_HOST_PORT:-3310}.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
62 lines
2.7 KiB
Bash
62 lines
2.7 KiB
Bash
# In all environments, the following files are loaded if they exist,
|
|
# the latter taking precedence over the former:
|
|
#
|
|
# * .env contains default values for the environment variables needed by the app
|
|
# * .env.local uncommitted file with local overrides
|
|
# * .env.$APP_ENV committed environment-specific defaults
|
|
# * .env.$APP_ENV.local uncommitted environment-specific overrides
|
|
#
|
|
# Real environment variables win over .env files.
|
|
#
|
|
# DO NOT DEFINE PRODUCTION SECRETS IN THIS FILE NOR IN ANY OTHER COMMITTED FILES.
|
|
# https://symfony.com/doc/current/configuration/secrets.html
|
|
#
|
|
# Run "composer dump-env prod" to compile .env files for production use (requires symfony/flex >=1.2).
|
|
# https://symfony.com/doc/current/best_practices.html#use-environment-variables-for-infrastructure-configuration
|
|
|
|
###> symfony/framework-bundle ###
|
|
# Committed default is the server (prod) profile. On the dev box, override in
|
|
# .env.local: APP_ENV=dev, a real APP_SECRET, and a local DATABASE_URL.
|
|
APP_ENV=prod
|
|
APP_SECRET=
|
|
APP_SHARE_DIR=var/share
|
|
# CIDR ranges the Nginx Proxy Manager / Docker network live in (loopback +
|
|
# RFC1918). Lets Symfony trust X-Forwarded-* from the reverse proxy.
|
|
TRUSTED_PROXIES=127.0.0.1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
|
|
###< symfony/framework-bundle ###
|
|
|
|
###> symfony/routing ###
|
|
# Configure how to generate URLs in non-HTTP contexts, such as CLI commands.
|
|
# See https://symfony.com/doc/current/routing.html#generating-urls-in-commands
|
|
DEFAULT_URI=https://dmtools.fvandenberg.nl
|
|
###< symfony/routing ###
|
|
|
|
###> doctrine/doctrine-bundle ###
|
|
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
|
|
#
|
|
# In Docker (servers) php talks to the `database` service on its own port
|
|
# 3306 - always. The host-published port (for a DB client on the server) is
|
|
# a separate thing: docker-compose.yml uses ${DB_HOST_PORT:-3310}, override
|
|
# it in .env.local if 3310 is taken.
|
|
#
|
|
# On the dev box, point DATABASE_URL at your local MariaDB in .env.local:
|
|
# DATABASE_URL="mysql://root:@127.0.0.1:3307/dmtools?serverVersion=10.10.2-MariaDB&charset=utf8mb4"
|
|
DB_NAME=dmtools
|
|
DB_USER=dmtools
|
|
DB_PASSWORD=ChangeMe
|
|
DB_ROOT_PASSWORD=ChangeMeRoot
|
|
DB_SERVER_VERSION=mariadb-12.3.2
|
|
DATABASE_URL="mysql://${DB_USER}:${DB_PASSWORD}@database:3306/${DB_NAME}?serverVersion=${DB_SERVER_VERSION}&charset=utf8mb4"
|
|
###< doctrine/doctrine-bundle ###
|
|
|
|
###> symfony/messenger ###
|
|
# Choose one of the transports below
|
|
# MESSENGER_TRANSPORT_DSN=amqp://guest:guest@localhost:5672/%2f/messages
|
|
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
|
|
MESSENGER_TRANSPORT_DSN=doctrine://default?auto_setup=0
|
|
###< symfony/messenger ###
|
|
|
|
###> symfony/mailer ###
|
|
MAILER_DSN=null://null
|
|
###< symfony/mailer ###
|