Skip to content

Commit

Permalink
Update env files and add docker files for development
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed May 3, 2022
1 parent 9b65c8c commit a594b67
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 14 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120

[{docker-compose.yml,docker-compose.override.yml}]
indent_size = 2

# markdown uses two trailing spaces for explicit line breaks
[*.md]
trim_trailing_whitespace = false
36 changes: 25 additions & 11 deletions .env
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
# This file is a "template" of which env vars need to be defined for your application
# Copy this file to .env file for development, create environment variables when deploying to production
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration

###> symfony/framework-bundle ###
APP_ENV=dev
APP_SECRET=a448d1dfcaa563fce56c2fd9981f662b
#TRUSTED_PROXIES=127.0.0.1,127.0.0.2
#TRUSTED_HOSTS=localhost,example.com
###< symfony/framework-bundle ###

###> symfony/mailer ###
# MAILER_DSN=null://null
###< symfony/mailer ###
###> symfony/lock ###
# Choose one of the stores below
# postgresql+advisory://db_user:db_password@localhost/db_name
LOCK_DSN=semaphore
###< symfony/lock ###

###> symfony/swiftmailer-bundle ###
# SwiftMailer DSN that is used for sending system notifications such as reset-password emails
# For Gmail as a transport, use: "gmail://username:password@localhost"
# For a generic SMTP server, use: "smtp://localhost:25?encryption=&auth_mode="
# Delivery is disabled by default via "null://localhost"
MAILER_URL=null://localhost
###< symfony/swiftmailer-bundle ###

###> doctrine/phpcr-bundle ###
###< doctrine/phpcr-bundle ###

###> doctrine/doctrine-bundle ###
# Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# For a PostgreSQL database, use: "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8"
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
DATABASE_URL=mysql://root:ChangeMe@127.0.0.1:3306/su_develop_sulu?serverVersion=5.7
#
# DATABASE_URL="sqlite:///%kernel.project_dir%/var/data.db"
# DATABASE_URL="postgresql://symfony:ChangeMe@127.0.0.1:5432/app?serverVersion=13&charset=utf8"
DATABASE_URL="mysql://root:ChangeMe@127.0.0.1:3306/sulu?serverVersion=8.0.27&charset=utf8mb4"
###< doctrine/doctrine-bundle ###

###> sulu/sulu-bundle ###
###> sulu/sulu ###
# Email address that will receive system notifications and might be used as universal fallback value by bundles
SULU_ADMIN_EMAIL=
###< sulu/sulu ###

###> symfony/mailer ###
# MAILER_DSN=null://null
###< symfony/mailer ###
6 changes: 3 additions & 3 deletions bin/console.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
use App\Kernel;
use Symfony\Bundle\FrameworkBundle\Console\Application;

if (!is_file(dirname(__DIR__).'/vendor/autoload_runtime.php')) {
if (!\is_file(\dirname(__DIR__) . '/vendor/autoload_runtime.php')) {
throw new LogicException('Symfony Runtime is missing. Try running "composer require symfony/runtime".');
}

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
require_once \dirname(__DIR__) . '/vendor/autoload_runtime.php';

if (!isset($suluContext)) {
$suluContext = Kernel::CONTEXT_ADMIN;
}

return function (array $context) use ($suluContext) {
return function(array $context) use ($suluContext) {
$kernel = new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG'], $suluContext);

return new Application($kernel);
Expand Down
Empty file added config/forms/.gitignore
Empty file.
Empty file added config/lists/.gitignore
Empty file.
14 changes: 14 additions & 0 deletions docker-compose.override.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
version: '3'

services:
###> doctrine/doctrine-bundle ###
database:
ports:
- "3306:3306"
###< doctrine/doctrine-bundle ###

###> symfony/mailer ###
mailer:
image: schickling/mailcatcher
ports: [1025, 1080]
###< symfony/mailer ###
22 changes: 22 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: '3'

services:
###> doctrine/doctrine-bundle ###
database:
# arm compatible mysql docker image
image: mysql/mysql-server:${MYSQL_VERSION:-8.0} # arm and x86/x64 compatible mysql image
environment:
MYSQL_DATABASE: ${MYSQL_DATABASE:-sulu}
# You should definitely change the password in production
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-ChangeMe}
MYSQL_ROOT_HOST: '%'
volumes:
- db-data:/var/lib/mysql
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/db/data:/var/lib/mysql:rw
###< doctrine/doctrine-bundle ###

volumes:
###> doctrine/doctrine-bundle ###
db-data:
###< doctrine/doctrine-bundle ###

0 comments on commit a594b67

Please sign in to comment.