Skip to content

Commit 021de9e

Browse files
committed
Add composer service
1 parent 49d832a commit 021de9e

File tree

5 files changed

+48
-1
lines changed

5 files changed

+48
-1
lines changed

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,12 @@ $RECYCLE.BIN/
6161

6262
# .nfs files are created when an open file is removed but is still being accessed
6363
.nfs*
64+
65+
### Composer template
66+
/vendor/
67+
composer.phar
68+
69+
# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
70+
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
71+
# composer.lock
72+

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
# Docker Web Stack
22

3+
34
# What's inside
45

5-
A `docker-compose`-powered stack to get your PHP web app project running.
6+
A `docker-compose`-powered stack to get your PHP project running in no time.
67

78
- PHP-FPM 7.1
89
- nginx
910
- MariaDB
1011
- Node w/ Yarn
1112

13+
1214
# Requirements
1315

1416
- `Docker` v17.03.1-ce or higher
1517
- `docker-compose` v1.11.2 or higher
1618

19+
1720
# How-to (simple)
1821

1922
To start the stack, run:
@@ -30,6 +33,12 @@ To stop the stack, run:
3033

3134
docker-compose stop
3235

36+
---
37+
38+
To install composer dependencies, run:
39+
40+
docker-compose run --rm composer install
41+
3342

3443
# How-to (advanced)
3544

@@ -43,6 +52,7 @@ To accomplish this, modify the Dockerfile, then run:
4352

4453
... followed by a `docker-compose up [arguments...]`
4554

55+
4656
# Warranties
4757

4858
- This stack was built on `macOS Sierra` v10.12.5. Experience may very on other operating systems.

composer.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "jpcaparas/docker-webapp",
3+
"description": "A docker-compose-powered stack to get your PHP project running in no time.",
4+
"type": "project",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "JP Caparas",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"minimum-stability": "dev",
13+
"require": {}
14+
}

docker-compose.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ services:
1313
volumes_from:
1414
- workspace
1515
restart: always
16+
composer:
17+
build:
18+
context: ./services/composer
19+
volumes:
20+
- ./:/app
1621
volumes:
1722
php-fpm:
1823
driver: "local"

services/composer/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM composer:1.4.2
2+
3+
# mark volume/s as externally mounted
4+
VOLUME ["/app"]
5+
6+
# starting point
7+
WORKDIR /app
8+
9+
CMD ["composer"]

0 commit comments

Comments
 (0)