Skip to content

Commit 139e89e

Browse files
author
Mauro Cassani
committedJun 20, 2017
Mapping volumes in Dockerfile
1 parent 5c2403e commit 139e89e

File tree

4 files changed

+29
-4
lines changed

4 files changed

+29
-4
lines changed
 

‎.dockerignore

+1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
config/parameters.yml
12
vendor

‎Dockerfile

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
FROM php:7.0-apache
22

3-
# Copy whole project
3+
# Copy the whole project into /var/www/html
4+
COPY / /var/www/html
5+
46
# Copy parameters.docker.yml into parameters.yml
5-
COPY / /var/www/html/
7+
RUN chown -R www-data:www-data /var/www/html
8+
RUN chmod 0775 /var/www/html
9+
RUN touch /var/www/html/config/parameters.yml
610
COPY config/parameters.docker.yml /var/www/html/config/parameters.yml
11+
712
WORKDIR /var/www/html/
813

914
# Composer

‎README.md

+19-2
Original file line numberDiff line numberDiff line change
@@ -509,15 +509,32 @@ memcached_parameters:
509509
510510
### 2. Run the project with Docker
511511
512-
You can simple run the project with [Docker](https://www.docker.com/):
512+
You can run the project with [Docker](https://www.docker.com/).
513+
514+
**STEP1: Make the build**
513515
514516
```
515517
docker-compose build
518+
```
519+
520+
**STEP2: Raise the app**
516521

522+
```
517523
docker-compose up -d
518524
```
519525

520-
Then, enter in the container and run the tests.
526+
**STEP3: Enter in the docker container**
527+
528+
```
529+
docker exec -it inmemorylist_app_1 bash
530+
```
531+
532+
**STEP4: Run the tests in the container**
533+
534+
```
535+
vendor/bin/phpunit
536+
```
537+
521538

522539
## Built With
523540

‎docker-compose.yml

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ services:
66
links:
77
- redis:redis
88
- memcached:memcached
9+
volumes:
10+
- /var/www/html
911
ports:
1012
- "5000:80"
1113

0 commit comments

Comments
 (0)