Skip to content

Commit

Permalink
feat: update environment configuration and Docker Compose files for i…
Browse files Browse the repository at this point in the history
…mproved setup
  • Loading branch information
ErwannRousseau committed Nov 24, 2024
1 parent f892bdb commit 5b8e4a7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 25 deletions.
11 changes: 11 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 1 addition & 7 deletions compose.override.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ###
24 changes: 6 additions & 18 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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 ###

0 comments on commit 5b8e4a7

Please sign in to comment.