[doctrine-bundle] Docker support

This commit is contained in:
Kévin Dunglas
2020-11-17 09:40:40 +01:00
committed by Fabien Potencier
parent af59c6fed6
commit ad93c11c2e
+22 -1
View File
@@ -10,7 +10,28 @@
"#1": "Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url",
"#2": "For an SQLite database, use: \"sqlite:///%kernel.project_dir%/var/data.db\"",
"#3": "For a PostgreSQL database, use: \"postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8\"",
"#4": "IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml",
"#4": "For the Docker integration, use: \"mysql://symfony:ChangeMe@db:3306/app?serverVersion=mariadb-10.5\"",
"#5": "IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml",
"DATABASE_URL": "mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
},
"dockerfile": ["RUN docker-php-ext-install pdo_mysql"],
"docker-compose": {
"services": [
"db:",
" image: mariadb:10.4",
" environment:",
" - MYSQL_DATABASE=app",
" # You should definitely change the password in production",
" - MYSQL_PASSWORD=ChangeMe",
" - MYSQL_RANDOM_ROOT_PASSWORD=true",
" - MYSQL_USER=symfony",
" volumes:",
" - db-data:/var/lib/mysql:rw",
" # 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",
" ports:",
" - \"3306\""
],
"volumes": ["db-data: {}"]
}
}