|
10 | 10 | "#1": "Format described at http://docs.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": "Configure your db driver and server_version in config/packages/doctrine.yaml",
|
13 |
| - "DATABASE_URL": "mysql://symfony:password@db:3306/symfony?charset=utf8mb4&serverVersion=5.7" |
| 13 | + "DATABASE_URL": "postgres://symfony:!ChangeMe!@db/symfony?serverVersion=11" |
14 | 14 | },
|
15 |
| - "dockerfile": ["RUN docker-php-ext-install pdo_mysql"], |
| 15 | + "dockerfile": [ |
| 16 | + "RUN apk add --no-cache postgresql-dev && \\", |
| 17 | + "\tdocker-php-ext-install pdo pdo_pgsql && \\", |
| 18 | + "\tapk del postgresql-dev" |
| 19 | + ], |
16 | 20 | "docker-compose": {
|
17 | 21 | "services": [
|
18 | 22 | "db:",
|
19 |
| - " image: mariadb:10.3", |
| 23 | + " image: postgres:11-alpine", |
20 | 24 | " environment:",
|
21 |
| - " - MYSQL_DATABASE=symfony", |
| 25 | + " - POSTGRES_DB=symfony", |
| 26 | + " - POSTGRES_USER=symfony", |
22 | 27 | " # You should definitely change the password in production",
|
23 |
| - " - MYSQL_PASSWORD=password", |
24 |
| - " - MYSQL_RANDOM_ROOT_PASSWORD=true", |
25 |
| - " - MYSQL_USER=symfony", |
| 28 | + " - POSTGRES_PASSWORD=!ChangeMe!", |
26 | 29 | " volumes:",
|
27 |
| - " - db-data:/var/lib/mysql:rw", |
| 30 | + " - db-data:/var/lib/postgresql/data:rw", |
28 | 31 | " # You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!",
|
29 |
| - " # - ./docker/db/data:/var/lib/mysql:rw" |
| 32 | + " # - ./docker/db/data:/var/lib/postgresql/data:rw", |
| 33 | + " ports:", |
| 34 | + " - \"5432:5432\"" |
30 | 35 | ],
|
31 | 36 | "volumes": ["db-data: {}"]
|
32 | 37 | }
|
|
0 commit comments