From 5b8e4a706d3dc5da16678dc33f01bd1f76381715 Mon Sep 17 00:00:00 2001 From: ErwannRousseau Date: Sun, 24 Nov 2024 19:19:09 +0100 Subject: [PATCH] feat: update environment configuration and Docker Compose files for improved setup --- .env | 11 +++++++++++ compose.override.yaml | 8 +------- compose.yaml | 24 ++++++------------------ 3 files changed, 18 insertions(+), 25 deletions(-) diff --git a/.env b/.env index 4dad41f..7253c12 100644 --- a/.env +++ b/.env @@ -18,3 +18,14 @@ APP_ENV=dev APP_SECRET=a012575cff2de944c9e81a23245ae063 ###< symfony/framework-bundle ### + +#################################################################################################### + +SERVER_NAME=app.localhost +CADDY_MERCURE_JWT_SECRET=!ChangeThisMercureHubJWTSecretKey! + +XDEBUG_MODE=off + +HTTP_PORT=80 +HTTPS_PORT=443 +HTTP3_PORT=443 diff --git a/compose.override.yaml b/compose.override.yaml index 9ac688a..3895ff5 100644 --- a/compose.override.yaml +++ b/compose.override.yaml @@ -8,17 +8,11 @@ services: - ./:/app - ./frankenphp/Caddyfile:/etc/caddy/Caddyfile:ro - ./frankenphp/conf.d/20-app.dev.ini:/usr/local/etc/php/app.conf.d/20-app.dev.ini:ro - # If you develop on Mac or Windows you can remove the vendor/ directory - # from the bind-mount for better performance by enabling the next line: - #- /app/vendor environment: MERCURE_EXTRA_DIRECTIVES: demo # See https://xdebug.org/docs/all_settings#mode - XDEBUG_MODE: "${XDEBUG_MODE:-off}" + XDEBUG_MODE: "${XDEBUG_MODE}" extra_hosts: # Ensure that host.docker.internal is correctly defined on Linux - host.docker.internal:host-gateway tty: true - -###> symfony/mercure-bundle ### -###< symfony/mercure-bundle ### diff --git a/compose.yaml b/compose.yaml index bd0a50a..b71a7cb 100644 --- a/compose.yaml +++ b/compose.yaml @@ -3,15 +3,9 @@ services: image: ${IMAGES_PREFIX:-}app-php restart: unless-stopped environment: - SERVER_NAME: ${SERVER_NAME:-app.localhost}, php:80 - MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} - MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} - # Run "composer require symfony/orm-pack" to install and configure Doctrine ORM - DATABASE_URL: postgresql://${POSTGRES_USER:-app}:${POSTGRES_PASSWORD:-!ChangeMe!}@database:5432/${POSTGRES_DB:-app}?serverVersion=${POSTGRES_VERSION:-15}&charset=${POSTGRES_CHARSET:-utf8} - # Run "composer require symfony/mercure-bundle" to install and configure the Mercure integration - MERCURE_URL: ${CADDY_MERCURE_URL:-http://php/.well-known/mercure} - MERCURE_PUBLIC_URL: ${CADDY_MERCURE_PUBLIC_URL:-https://${SERVER_NAME:-localhost}/.well-known/mercure} - MERCURE_JWT_SECRET: ${CADDY_MERCURE_JWT_SECRET:-!ChangeThisMercureHubJWTSecretKey!} + SERVER_NAME: ${SERVER_NAME}, php:80 + MERCURE_PUBLISHER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET} + MERCURE_SUBSCRIBER_JWT_KEY: ${CADDY_MERCURE_JWT_SECRET} # The two next lines can be removed after initial installation SYMFONY_VERSION: ${SYMFONY_VERSION:-} STABILITY: ${STABILITY:-stable} @@ -21,23 +15,17 @@ services: ports: # HTTP - target: 80 - published: ${HTTP_PORT:-80} + published: ${HTTP_PORT} protocol: tcp # HTTPS - target: 443 - published: ${HTTPS_PORT:-443} + published: ${HTTPS_PORT} protocol: tcp # HTTP/3 - target: 443 - published: ${HTTP3_PORT:-443} + published: ${HTTP3_PORT} protocol: udp -# Mercure is installed as a Caddy module, prevent the Flex recipe from installing another service -###> symfony/mercure-bundle ### -###< symfony/mercure-bundle ### - volumes: caddy_data: caddy_config: -###> symfony/mercure-bundle ### -###< symfony/mercure-bundle ###