|
10 | 10 | "#1": "Format described at https://www.doctrine-project.org/projects/doctrine-dbal/en/latest/reference/configuration.html#connecting-using-a-url",
|
11 | 11 | "#2": "For an SQLite database, use: \"sqlite:///%kernel.project_dir%/var/data.db\"",
|
12 | 12 | "#3": "For a PostgreSQL database, use: \"postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8\"",
|
13 |
| - "#4": "IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml", |
| 13 | + "#4": "For the Docker integration, use: \"mysql://symfony:ChangeMe@db:3306/app?serverVersion=mariadb-10.5\"", |
| 14 | + "#5": "IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml", |
14 | 15 | "DATABASE_URL": "mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7"
|
| 16 | + }, |
| 17 | + "dockerfile": ["RUN docker-php-ext-install pdo_mysql"], |
| 18 | + "docker-compose": { |
| 19 | + "services": [ |
| 20 | + "db:", |
| 21 | + " image: mariadb:10.4", |
| 22 | + " environment:", |
| 23 | + " - MYSQL_DATABASE=app", |
| 24 | + " # You should definitely change the password in production", |
| 25 | + " - MYSQL_PASSWORD=ChangeMe", |
| 26 | + " - MYSQL_RANDOM_ROOT_PASSWORD=true", |
| 27 | + " - MYSQL_USER=symfony", |
| 28 | + " volumes:", |
| 29 | + " - db-data:/var/lib/mysql:rw", |
| 30 | + " # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!", |
| 31 | + " # - ./docker/db/data:/var/lib/mysql:rw", |
| 32 | + " ports:", |
| 33 | + " - \"3306\"" |
| 34 | + ], |
| 35 | + "volumes": ["db-data: {}"] |
15 | 36 | }
|
16 | 37 | }
|
0 commit comments