-
-
Save alexmazaltov/879e088db0f81b3a255a179887c9ea92 to your computer and use it in GitHub Desktop.
drupal 8 core contributor docker kickstarter
This file contains hidden or 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
version: "2.1" | |
services: | |
php: | |
image: skilldlabs/php:73-fpm-dev | |
container_name: core8 | |
restart: always | |
working_dir: /var/www/html/web | |
volumes: | |
- .:/var/www/html/web:z | |
- ./.cache/composer:/home/www-data/.composer/cache:z | |
# Uncomment next line if you need PHP Xdebug. | |
# command: php-fpm7 -F -e -d rlimit_core=unlimited -d zend_extension=xdebug.so | |
environment: | |
MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless"]}}, "http://chrome:4444"]' | |
networks: | |
- front | |
nginx: | |
image: skilldlabs/nginx:1.16.1 | |
container_name: "core8_nginx" | |
restart: always | |
depends_on: | |
- php | |
volumes_from: | |
- php | |
networks: | |
- front | |
# logging: | |
# driver: "journald" | |
# options: | |
# tag: "{{.Name}}" | |
chrome: | |
image: drupalci/webdriver-chromedriver:production | |
ulimits: | |
core: | |
soft: -1 | |
hard: -1 | |
cap_add: | |
- SYS_ADMIN | |
volumes: | |
- /dev/shm:/dev/shm | |
ports: | |
- "4444:4444" | |
entrypoint: | |
- chromedriver | |
- "--port=4444" | |
- "--no-sandbox" | |
- "--whitelisted-ips=" | |
# - "--log-path=/tmp/chromedriver.log" | |
- "--log-level=INFO" | |
# - "--verbose" | |
networks: | |
- front | |
networks: | |
front: | |
driver: bridge |
This file contains hidden or 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
.PHONY: up upx log down exec exec0 h t | |
CUID := $(shell id -u) | |
CGID := $(shell id -g) | |
IMAGEPHP := skilldlabs/php:73 | |
all: | exec | |
up: | |
docker run --rm --name core8 \ | |
-u $(CUID):$(CGID) \ | |
-v $(shell pwd):/srv \ | |
-p 8080:8080 -d \ | |
$(IMAGEPHP) php -S 0.0.0.0:8080 \ | |
.ht.router.php | |
docker exec -u 0:0 core8 adduser -D www | |
h: | |
docker exec -u $(CUID):$(CGID) core8 composer global require -o --update-no-dev --no-suggest "hirak/prestissimo:^0.3" | |
upx: | |
docker run --rm --name core8 \ | |
-u $(CUID):$(CGID) \ | |
-v $(shell pwd):/srv \ | |
-p 8080:8080 \ | |
$(IMAGEPHP) php -d zend_extension=xdebug.so -S 0.0.0.0:8080 \ | |
.ht.router.php | |
docker exec core8 adduser -D www | |
log: | |
docker logs -f --tail=10 core8 | |
down: | |
docker stop core8 | |
exec: | |
docker exec -it -u $(CUID):$(CGID) core8 ash | |
exec0: | |
docker exec -it -u 0:0 core8 ash | |
t: | |
docker exec \ | |
-e SIMPLETEST_BASE_URL=http://localhost:8080 \ | |
-e SIMPLETEST_DB=sqlite://./db/d8.db \ | |
core8 vendor/bin/phpunit -c core/phpunit.xml.dist --debug ${t} | |
# Docker compose related goals | |
test: | |
docker exec \ | |
-u $(CUID):$(CGID) \ | |
-e SIMPLETEST_BASE_URL=http://nginx \ | |
-e SIMPLETEST_DB=sqlite://./db/tests.db \ | |
-e BROWSERTEST_OUTPUT_DIRECTORY=./sites/simpletest/out \ | |
core8 vendor/bin/phpunit -c core/phpunit.xml.dist --colors=always \ | |
--printer="\Drupal\Tests\Listeners\HtmlOutputPrinter" --debug -v \ | |
${t} | |
start: | |
docker-compose up -d php nginx | |
stop: | |
docker-compose down -v --remove-orphans |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment