Skip to content

Commit f354748

Browse files
Merge pull request #5 from michaelperrin/feature/mysql
Add MySQL container and configuration for PHP
2 parents 678074f + f9d217c commit f354748

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

docker-compose.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ version: '2'
22
services:
33
php:
44
build: ./docker/php/
5+
depends_on:
6+
- mysql
57
environment:
68
TIMEZONE: Europe/Paris
79
XDEBUG_REMOTE_HOST: 10.200.10.1
@@ -23,3 +25,13 @@ services:
2325
- ./docker/nginx/app.conf:/etc/nginx/conf.d/default.conf:ro
2426
ports:
2527
- 80:80
28+
29+
mysql:
30+
image: mysql:5.6
31+
environment:
32+
MYSQL_ROOT_PASSWORD: root_password_test
33+
MYSQL_DATABASE: db_test
34+
MYSQL_USER: user_test
35+
MYSQL_PASSWORD: password_test
36+
ports:
37+
- "3306:3306"

docker/php/Dockerfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ RUN apt-get install -y \
2525
&& docker-php-ext-install gd \
2626
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
2727

28+
RUN docker-php-ext-install pdo_mysql
29+
2830
# Fix permissions
2931
RUN usermod -u 1000 www-data
3032

0 commit comments

Comments
 (0)