-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
01d5bd4
commit 0abe3cb
Showing
9 changed files
with
140 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
HOST_WEB_PORT=8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
vendor/ | ||
composer.lock | ||
phpunit.xml | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.PHONY: help | ||
.DEFAULT_GOAL := help | ||
|
||
$(VERBOSE).SILENT: | ||
|
||
help: | ||
grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \ | ||
cut -d: -f2- | \ | ||
sort -d | \ | ||
awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-16s\033[0m %s\n", $$1, $$2}' | ||
|
||
.PHONY: up down composer-install composer-update test | ||
|
||
up: | ||
docker-compose -f docker-compose.examples.yml stop --timeout=2 && docker-compose -f docker-compose.examples.yml up -d | ||
|
||
down: | ||
docker-compose -f docker-compose.examples.yml stop --timeout=2 | ||
|
||
composer-install: | ||
docker run --rm --interactive --tty --volume $(PWD):/app --user $(id -u):$(id -g) composer install --ignore-platform-reqs | ||
|
||
composer-update: | ||
docker run --rm --interactive --tty --volume $(PWD):/app --user $(id -u):$(id -g) composer update --ignore-platform-reqs | ||
|
||
test: | ||
docker-compose -f docker-compose.yml up |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
daemon off; | ||
worker_processes auto; | ||
pid /run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
include /etc/nginx/conf.d/*.conf; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
set -e | ||
|
||
export DOLLAR='$' | ||
|
||
rm -f /etc/nginx/conf.d/* | ||
rm -Rf /var/www/html | ||
|
||
envsubst < /var/www/build/nginx.conf > /etc/nginx/nginx.conf | ||
envsubst < /var/www/build/site.conf > /etc/nginx/conf.d/20-site.conf | ||
|
||
nginx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
server { | ||
listen 80; | ||
|
||
server_name _; | ||
root /var/www/examples; | ||
index index.php; | ||
|
||
access_log off; | ||
log_not_found off; | ||
|
||
location / { | ||
try_files ${DOLLAR}uri /index.php${DOLLAR}is_args${DOLLAR}args; | ||
} | ||
|
||
location ~ \.php$ { | ||
fastcgi_pass yin-examples-php-fpm:9000; | ||
internal; | ||
include fastcgi_params; | ||
fastcgi_param SCRIPT_FILENAME ${DOLLAR}document_root${DOLLAR}fastcgi_script_name; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
version: '2' | ||
|
||
services: | ||
yin-examples-nginx: | ||
image: nginx:1.15-alpine | ||
container_name: yin-examples-nginx | ||
networks: | ||
- yin-examples | ||
volumes: | ||
- .:/var/www/ | ||
ports: | ||
- "$HOST_WEB_PORT:80" | ||
command: /var/www/build/nginx.sh | ||
env_file: | ||
- .env | ||
depends_on: | ||
- yin-examples-php-fpm | ||
|
||
yin-examples-php-fpm: | ||
container_name: yin-examples-php-fpm | ||
image: php:7.2-fpm | ||
networks: | ||
- yin-examples | ||
volumes: | ||
- .:/var/www/ | ||
|
||
networks: | ||
yin-examples: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters