Skip to content

Commit

Permalink
Extended environment configuration, async messenger functionality, do…
Browse files Browse the repository at this point in the history
…cumentation, fixed rabbitmq volumes mapping issue.
  • Loading branch information
DKravtsov committed Oct 15, 2024
1 parent 8384676 commit 8643b89
Show file tree
Hide file tree
Showing 56 changed files with 3,258 additions and 2,404 deletions.
49 changes: 40 additions & 9 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,48 @@
COMPOSE_PROJECT_NAME=backend
###< docker compose configuration ###

###> docker configuration that can be overridden in .env.local ###
###> NGinx docker configuration. Can be overridden in: .env.local, .env.staging, .env.prod. ###
WEB_PORT_HTTP=80
WEB_PORT_SSL=443
###< Nginx docker configuration ###

###> XDebug docker configuration. Can be overridden in: .env.local. ###
# XDEBUG_CONFIG possible values: main|osx. Use main value for Linux and Windows, osx value for MacOS.
XDEBUG_CONFIG=main
# Sometimes we need to use different xdebug versions, list of versions can be found here - https://pecl.php.net/package/xdebug
XDEBUG_VERSION=3.3.2
###< XDebug docker configuration ###

###> MySQL docker configuration. Can be overridden in: .env.local, .env.staging, .env.prod. ###
# MySQL version, recommend values: 8.4.2|8.3.0|8.2.0|8.1.0|8.0.39
MYSQL_VERSION=8.4.2
# MySQL INNODB_USE_NATIVE_AIO possible values: 1|0. Set to 0 when AIO interface is not supported on OSX. https://dev.mysql.com/doc/refman/8.0/en/innodb-parameters.html#sysvar_innodb_use_native_aio
INNODB_USE_NATIVE_AIO=1
# Sometimes AWS MySQL RDS has SQL_MODE="NO_ENGINE_SUBSTITUTION" (https://github.com/awsdocs/amazon-rds-user-guide/issues/160) but MySQL default described here - https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_sql_mode
SQL_MODE="ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
###< docker configuration that can be overridden in .env.local ###
MYSQL_ROOT_PASSWORD=secret
MYSQL_PORT=33061
###< MySQL docker configuration ###

###> RabbitMQ docker configuration. Can be overridden in: .env.local, .env.staging, .env.prod. ###
RABBITMQ_ERLANG_COOKIE=7ead507151fc4461b9f45c1161384a04
RABBITMQ_USER=guest
RABBITMQ_PASS=guest
RABBITMQ_MANAGEMENT_PORT=15672
###< RabbitMQ docker configuration ###

###> Elasticsearch docker configuration. Can be overridden in: .env.local, .env.staging, .env.prod. ###
ELK_VERSION=7.10.1
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=changeme
ELASTIC_HTTP_PORT=9200
ELASTIC_TRANSPORT_PORT=9300
KIBANA_PORT=5601
###< Elasticsearch docker configuration ###

###> Redis docker configuration. Can be overridden in: .env.local. ###
REDIS_PORT=6379
###< Redis docker configuration ###

###> symfony/framework-bundle ###
APP_ENV=dev
Expand All @@ -47,7 +75,7 @@ TRUSTED_PROXIES=127.0.0.1,REMOTE_ADDR
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="postgresql://app:!ChangeMe!@127.0.0.1:5432/app?serverVersion=15&charset=utf8"
DATABASE_URL=mysql://root:secret@mysql:3306/symfony
DATABASE_URL=mysql://root:${MYSQL_ROOT_PASSWORD}@mysql:3306/symfony
###< doctrine/doctrine-bundle ###

###> redis ###
Expand All @@ -62,17 +90,20 @@ APP_ERROR_RECEIVER_EMAIL=admin@localhost
###< symfony/mailer ###

###> symfony/messenger ###
MESSENGER_TRANSPORT_DSN=amqp://guest:guest@rabbitmq:5672/%2f/messages
MESSENGER_TRANSPORT_DSN=amqp://${RABBITMQ_USER}:${RABBITMQ_PASS}@rabbitmq:5672/%2f/messages
# Send "failed" messages for unlimited retry (messenger:failed:retry). Possible values: 0|1. In case 1 - failed messages will be sent for unlimited retry. In case 0 - only 1 retry is possible.
MESSENGER_FAILED_IS_RETRYABLE=1
# Time in miliseconds before retry for "failed" messages (messenger:failed:retry). Available in case MESSENGER_FAILED_IS_RETRYABLE=1.
MESSENGER_FAILED_RETRY_WAITING_TIME=10000
# How many days we should have failed messages inside messenger_messages table
MESSENGER_MESSAGES_HISTORY_DAYS=7
###< symfony/messenger ###

###> Elasticsearch configuration ###
ELK_VERSION=7.10.1
###> Elasticsearch app configuration ###
ELASTICSEARCH_HOST=http://elasticsearch:9200
ELASTICSEARCH_NUMBER_OF_SHARDS=1
ELASTICSEARCH_NUMBER_OF_REPLICAS=0
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=changeme
###< Elasticsearch configuration ###
###< Elasticsearch app configuration ###

###> lexik/jwt-authentication-bundle ###
JWT_SECRET_KEY=config/jwt/private.pem
Expand Down
20 changes: 16 additions & 4 deletions .env.prod
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# define your env variables for the prod env here
MYSQL_ROOT_PASSWORD=secret

RABBITMQ_ERLANG_COOKIE=7ead507151fc4461b9f45c1161384a04
RABBITMQ_USER=guest
RABBITMQ_PASS=guest

# When editing Elastic creds, do not forget to change X-Pack security credentials for kibana (docker/prod/kibana.yml)
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=changeme

APP_ENV=prod
APP_SECRET=42f011ec3a7bde0bec87364b1d967194
APP_DEBUG=0

###> doctrine/doctrine-bundle ###
DATABASE_URL=mysql://root:secret@mysql:3306/symfony
DATABASE_URL=mysql://root:${MYSQL_ROOT_PASSWORD}@mysql:3306/symfony
###< doctrine/doctrine-bundle ###

###> redis ###
Expand All @@ -19,17 +29,19 @@ APP_ERROR_RECEIVER_EMAIL=admin@localhost
###< symfony/mailer ###

###> symfony/messenger ###
MESSENGER_TRANSPORT_DSN=amqp://guest:guest@rabbitmq:5672/%2f/messages
MESSENGER_TRANSPORT_DSN=amqp://${RABBITMQ_USER}:${RABBITMQ_PASS}@rabbitmq:5672/%2f/messages
###< symfony/messenger ###

###> Elasticsearch configuration ###
ELASTICSEARCH_HOST=http://elasticsearch:9200
ELASTICSEARCH_NUMBER_OF_SHARDS=1
ELASTICSEARCH_NUMBER_OF_REPLICAS=0
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=changeme
###< Elasticsearch configuration ###

###> lexik/jwt-authentication-bundle ###
JWT_PASSPHRASE=3a37d3afd9accc7959f952b2ae555d21
###< lexik/jwt-authentication-bundle ###

###> symfony/lock ###
LOCK_DSN=redis://redis:6379
###< symfony/lock ###
20 changes: 16 additions & 4 deletions .env.staging
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# define your env variables for the staging env here
MYSQL_ROOT_PASSWORD=secret

RABBITMQ_ERLANG_COOKIE=7ead507151fc4461b9f45c1161384a04
RABBITMQ_USER=guest
RABBITMQ_PASS=guest

# When editing Elastic creds, do not forget to change X-Pack security credentials for kibana (docker/staging/kibana.yml)
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=changeme

APP_ENV=staging
APP_SECRET=42f011ec3a7bde0bec87364b1d967194
APP_DEBUG=0

###> doctrine/doctrine-bundle ###
DATABASE_URL=mysql://root:secret@mysql:3306/symfony
DATABASE_URL=mysql://root:${MYSQL_ROOT_PASSWORD}@mysql:3306/symfony
###< doctrine/doctrine-bundle ###

###> redis ###
Expand All @@ -19,15 +29,17 @@ APP_ERROR_RECEIVER_EMAIL=admin@localhost
###< symfony/mailer ###

###> symfony/messenger ###
MESSENGER_TRANSPORT_DSN=amqp://guest:guest@rabbitmq:5672/%2f/messages
MESSENGER_TRANSPORT_DSN=amqp://${RABBITMQ_USER}:${RABBITMQ_PASS}@rabbitmq:5672/%2f/messages
###< symfony/messenger ###

###> Elasticsearch configuration ###
ELASTICSEARCH_HOST=http://elasticsearch:9200
ELASTICSEARCH_USERNAME=elastic
ELASTICSEARCH_PASSWORD=changeme
###< Elasticsearch configuration ###

###> lexik/jwt-authentication-bundle ###
JWT_PASSPHRASE=3a37d3afd9accc7959f952b2ae555d21
###< lexik/jwt-authentication-bundle ###

###> symfony/lock ###
LOCK_DSN=redis://redis:6379
###< symfony/lock ###
2 changes: 1 addition & 1 deletion .env.test
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ APP_DEBUG=0
SYMFONY_DEPRECATIONS_HELPER=999999

###> doctrine/doctrine-bundle ###
DATABASE_URL=mysql://root:secret@mysql:3306/symfony_testing
DATABASE_URL=mysql://root:${MYSQL_ROOT_PASSWORD}@mysql:3306/symfony_testing
###< doctrine/doctrine-bundle ###

###> symfony/mailer ###
Expand Down
Loading

0 comments on commit 8643b89

Please sign in to comment.