Skip to content

Commit e3761a6

Browse files
authored
Merge pull request #390 from jolicode/wiki-mysql-mariadb
Add wiki for mariadb and move mysql/mariadb wiki higher
2 parents 1954517 + b105662 commit e3761a6

1 file changed

Lines changed: 186 additions & 93 deletions

File tree

README.md

Lines changed: 186 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,192 @@ Usually, there is three places where you need to do it:
154154

155155
</details>
156156

157+
### How to use MariaDB instead of PostgreSQL
158+
159+
<details>
160+
161+
<summary>Read the cookbook</summary>
162+
163+
In order to use MariaDB, you will need to apply this patch:
164+
165+
```diff
166+
diff --git a/infrastructure/docker/docker-compose.builder.yml b/infrastructure/docker/docker-compose.builder.yml
167+
index d00f315..bdfdc65 100644
168+
--- a/infrastructure/docker/docker-compose.builder.yml
169+
+++ b/infrastructure/docker/docker-compose.builder.yml
170+
@@ -10,7 +10,7 @@ services:
171+
builder:
172+
build: services/builder
173+
depends_on:
174+
- - postgres
175+
+ - mariadb
176+
environment:
177+
- COMPOSER_MEMORY_LIMIT=-1
178+
volumes:
179+
diff --git a/infrastructure/docker/docker-compose.worker.yml b/infrastructure/docker/docker-compose.worker.yml
180+
index 2eda814..59f8fed 100644
181+
--- a/infrastructure/docker/docker-compose.worker.yml
182+
+++ b/infrastructure/docker/docker-compose.worker.yml
183+
@@ -5,7 +5,7 @@ x-services-templates:
184+
worker_base: &worker_base
185+
build: services/worker
186+
depends_on:
187+
- - postgres
188+
+ - mariadb
189+
#- rabbitmq
190+
volumes:
191+
- "../..:/var/www:cached"
192+
diff --git a/infrastructure/docker/docker-compose.yml b/infrastructure/docker/docker-compose.yml
193+
index 49a2661..1804a01 100644
194+
--- a/infrastructure/docker/docker-compose.yml
195+
+++ b/infrastructure/docker/docker-compose.yml
196+
@@ -1,7 +1,7 @@
197+
version: '3.7'
198+
199+
volumes:
200+
- postgres-data: {}
201+
+ mariadb-data: {}
202+
203+
services:
204+
router:
205+
@@ -13,7 +13,7 @@ services:
206+
frontend:
207+
build: services/frontend
208+
depends_on:
209+
- - postgres
210+
+ - mariadb
211+
volumes:
212+
- "../..:/var/www:cached"
213+
labels:
214+
@@ -24,10 +24,7 @@ services:
215+
# Comment the next line to be able to access frontend via HTTP instead of HTTPS
216+
- "traefik.http.routers.${PROJECT_NAME}-frontend-unsecure.middlewares=redirect-to-https@file"
217+
218+
- postgres:
219+
- image: postgres:16
220+
- environment:
221+
- - POSTGRES_USER=app
222+
- - POSTGRES_PASSWORD=app
223+
+ mariadb:
224+
+ image: mariadb:11
225+
+ environment:
226+
+ - MARIADB_ALLOW_EMPTY_ROOT_PASSWORD=1
227+
+ healthcheck:
228+
+ test: "mariadb-admin ping -h localhost"
229+
+ interval: 5s
230+
+ timeout: 5s
231+
+ retries: 10
232+
volumes:
233+
- - postgres-data:/var/lib/postgresql/data
234+
+ - mariadb-data:/var/lib/mysql
235+
diff --git a/infrastructure/docker/services/php/Dockerfile b/infrastructure/docker/services/php/Dockerfile
236+
index 56e1835..95fee78 100644
237+
--- a/infrastructure/docker/services/php/Dockerfile
238+
+++ b/infrastructure/docker/services/php/Dockerfile
239+
@@ -24,7 +24,7 @@ RUN apk add --no-cache \
240+
php${PHP_VERSION}-intl \
241+
php${PHP_VERSION}-mbstring \
242+
- php${PHP_VERSION}-pgsql \
243+
+ php${PHP_VERSION}-mysql \
244+
php${PHP_VERSION}-xml \
245+
php${PHP_VERSION}-zip \
246+
```
247+
248+
</details>
249+
250+
### How to use MySQL instead of PostgreSQL
251+
252+
<details>
253+
254+
<summary>Read the cookbook</summary>
255+
256+
In order to use MySQL, you will need to apply this patch:
257+
258+
```diff
259+
diff --git a/infrastructure/docker/docker-compose.builder.yml b/infrastructure/docker/docker-compose.builder.yml
260+
index d00f315..bdfdc65 100644
261+
--- a/infrastructure/docker/docker-compose.builder.yml
262+
+++ b/infrastructure/docker/docker-compose.builder.yml
263+
@@ -10,7 +10,7 @@ services:
264+
builder:
265+
build: services/builder
266+
depends_on:
267+
- - postgres
268+
+ - mysql
269+
environment:
270+
- COMPOSER_MEMORY_LIMIT=-1
271+
volumes:
272+
diff --git a/infrastructure/docker/docker-compose.worker.yml b/infrastructure/docker/docker-compose.worker.yml
273+
index 2eda814..59f8fed 100644
274+
--- a/infrastructure/docker/docker-compose.worker.yml
275+
+++ b/infrastructure/docker/docker-compose.worker.yml
276+
@@ -5,7 +5,7 @@ x-services-templates:
277+
worker_base: &worker_base
278+
build: services/worker
279+
depends_on:
280+
- - postgres
281+
+ - mysql
282+
#- rabbitmq
283+
volumes:
284+
- "../..:/var/www:cached"
285+
diff --git a/infrastructure/docker/docker-compose.yml b/infrastructure/docker/docker-compose.yml
286+
index 49a2661..1804a01 100644
287+
--- a/infrastructure/docker/docker-compose.yml
288+
+++ b/infrastructure/docker/docker-compose.yml
289+
@@ -1,7 +1,7 @@
290+
version: '3.7'
291+
292+
volumes:
293+
- postgres-data: {}
294+
+ mysql-data: {}
295+
296+
services:
297+
router:
298+
@@ -13,7 +13,7 @@ services:
299+
frontend:
300+
build: services/frontend
301+
depends_on:
302+
- - postgres
303+
+ - mysql
304+
volumes:
305+
- "../..:/var/www:cached"
306+
labels:
307+
@@ -24,10 +24,7 @@ services:
308+
# Comment the next line to be able to access frontend via HTTP instead of HTTPS
309+
- "traefik.http.routers.${PROJECT_NAME}-frontend-unsecure.middlewares=redirect-to-https@file"
310+
311+
- postgres:
312+
- image: postgres:16
313+
- environment:
314+
- - POSTGRES_USER=app
315+
- - POSTGRES_PASSWORD=app
316+
+ mysql:
317+
+ image: mysql:8
318+
+ environment:
319+
+ - MYSQL_ALLOW_EMPTY_PASSWORD=1
320+
+ healthcheck:
321+
+ test: "mysqladmin ping -h localhost"
322+
+ interval: 5s
323+
+ timeout: 5s
324+
+ retries: 10
325+
volumes:
326+
- - postgres-data:/var/lib/postgresql/data
327+
+ - mysql-data:/var/lib/mysql
328+
diff --git a/infrastructure/docker/services/php/Dockerfile b/infrastructure/docker/services/php/Dockerfile
329+
index 56e1835..95fee78 100644
330+
--- a/infrastructure/docker/services/php/Dockerfile
331+
+++ b/infrastructure/docker/services/php/Dockerfile
332+
@@ -24,7 +24,7 @@ RUN apk add --no-cache \
333+
php${PHP_VERSION}-intl \
334+
php${PHP_VERSION}-mbstring \
335+
- php${PHP_VERSION}-pgsql \
336+
+ php${PHP_VERSION}-mysql \
337+
php${PHP_VERSION}-xml \
338+
php${PHP_VERSION}-zip \
339+
```
340+
341+
</details>
342+
157343
### How to use with Webpack Encore
158344

159345
<details>
@@ -855,99 +1041,6 @@ castor app:db:pg-activity
8551041

8561042
</details>
8571043

858-
### How to use MySQL instead of PostgreSQL
859-
860-
<details>
861-
862-
<summary>Read the cookbook</summary>
863-
864-
In order to use MySQL, you will need to apply this patch:
865-
866-
```diff
867-
diff --git a/infrastructure/docker/docker-compose.builder.yml b/infrastructure/docker/docker-compose.builder.yml
868-
index d00f315..bdfdc65 100644
869-
--- a/infrastructure/docker/docker-compose.builder.yml
870-
+++ b/infrastructure/docker/docker-compose.builder.yml
871-
@@ -10,7 +10,7 @@ services:
872-
builder:
873-
build: services/builder
874-
depends_on:
875-
- - postgres
876-
+ - mysql
877-
environment:
878-
- COMPOSER_MEMORY_LIMIT=-1
879-
volumes:
880-
diff --git a/infrastructure/docker/docker-compose.worker.yml b/infrastructure/docker/docker-compose.worker.yml
881-
index 2eda814..59f8fed 100644
882-
--- a/infrastructure/docker/docker-compose.worker.yml
883-
+++ b/infrastructure/docker/docker-compose.worker.yml
884-
@@ -5,7 +5,7 @@ x-services-templates:
885-
worker_base: &worker_base
886-
build: services/worker
887-
depends_on:
888-
- - postgres
889-
+ - mysql
890-
#- rabbitmq
891-
volumes:
892-
- "../..:/var/www:cached"
893-
diff --git a/infrastructure/docker/docker-compose.yml b/infrastructure/docker/docker-compose.yml
894-
index 49a2661..1804a01 100644
895-
--- a/infrastructure/docker/docker-compose.yml
896-
+++ b/infrastructure/docker/docker-compose.yml
897-
@@ -1,7 +1,7 @@
898-
version: '3.7'
899-
900-
volumes:
901-
- postgres-data: {}
902-
+ mysql-data: {}
903-
904-
services:
905-
router:
906-
@@ -13,7 +13,7 @@ services:
907-
frontend:
908-
build: services/frontend
909-
depends_on:
910-
- - postgres
911-
+ - mysql
912-
volumes:
913-
- "../..:/var/www:cached"
914-
labels:
915-
@@ -24,10 +24,7 @@ services:
916-
# Comment the next line to be able to access frontend via HTTP instead of HTTPS
917-
- "traefik.http.routers.${PROJECT_NAME}-frontend-unsecure.middlewares=redirect-to-https@file"
918-
919-
- postgres:
920-
- image: postgres:16
921-
- environment:
922-
- - POSTGRES_USER=app
923-
- - POSTGRES_PASSWORD=app
924-
+ mysql:
925-
+ image: mysql:8
926-
+ environment:
927-
+ - MYSQL_ALLOW_EMPTY_PASSWORD=1
928-
+ healthcheck:
929-
+ test: "mysqladmin ping -h localhost"
930-
+ interval: 5s
931-
+ timeout: 5s
932-
+ retries: 10
933-
volumes:
934-
- - postgres-data:/var/lib/postgresql/data
935-
+ - mysql-data:/var/lib/mysql
936-
diff --git a/infrastructure/docker/services/php/Dockerfile b/infrastructure/docker/services/php/Dockerfile
937-
index 56e1835..95fee78 100644
938-
--- a/infrastructure/docker/services/php/Dockerfile
939-
+++ b/infrastructure/docker/services/php/Dockerfile
940-
@@ -24,7 +24,7 @@ RUN apk add --no-cache \
941-
php${PHP_VERSION}-intl \
942-
php${PHP_VERSION}-mbstring \
943-
- php${PHP_VERSION}-pgsql \
944-
+ php${PHP_VERSION}-mysql \
945-
php${PHP_VERSION}-xml \
946-
php${PHP_VERSION}-zip \
947-
```
948-
949-
</details>
950-
9511044
### Docker For Windows support
9521045

9531046
<details>

0 commit comments

Comments
 (0)