Skip to content

Commit cee1f78

Browse files
committed
Add Dockerfile and docker-compose.yml
1 parent 1e13010 commit cee1f78

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

docker-compose.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@ version: "3.7"
22

33
services:
44
app:
5-
build: docker
5+
build: ./docker
6+
image: thecodeholic/php_mvc
67
ports:
78
- "80:80"
89
volumes:
910
# Mount source-code for development
1011
- ./:/var/www
12+
db:
13+
image: mysql:8
14+
ports:
15+
- "3307:3306"
16+
environment:
17+
MYSQL_DATABASE: php_mvc
18+
MYSQL_ROOT_PASSWORD: root
19+
MYSQL_USER: php_mvc
20+
MYSQL_PASSWORD: php_mvc

docker/Dockerfile

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,15 @@ COPY 000-default.conf /etc/apache2/sites-available/000-default.conf
66
# Enable rewrite mode
77
RUN a2enmod rewrite
88

9-
# Install git
10-
RUN apt-get update
11-
RUN apt-get install libzip-dev git unzip -y --no-install-recommends
12-
13-
# RUN docker-php-ext-install zip intl mbstring pdo_mysql exif gd
9+
# Install necessary packages
10+
RUN apt-get update && \
11+
apt-get install \
12+
libzip-dev \
13+
git \
14+
unzip \
15+
-y --no-install-recommends
16+
17+
# Install PHP Extensions
1418
RUN docker-php-ext-install zip pdo_mysql
1519

1620
# Install composer

0 commit comments

Comments
 (0)