Skip to content

Commit 9d76d13

Browse files
committed
Initial commit
0 parents  commit 9d76d13

32 files changed

+14193
-0
lines changed

.env.example

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
### Documentation available at https://wodby.com/docs/stacks/drupal/local
2+
### Changelog can be found at https://github.com/wodby/docker4drupal/releases
3+
### Images tags format explained at https://github.com/wodby/docker4drupal#images-tags
4+
5+
### PROJECT SETTINGS
6+
7+
PROJECT_NAME=my_drupal8_project
8+
PROJECT_BASE_URL=drupal.docker.localhost
9+
10+
DB_NAME=drupal
11+
DB_USER=drupal
12+
DB_PASSWORD=drupal
13+
DB_ROOT_PASSWORD=password
14+
DB_HOST=mariadb
15+
DB_PORT=3306
16+
DB_DRIVER=mysql
17+
18+
### --- MARIADB ----
19+
20+
MARIADB_TAG=10.4-3.8.2
21+
#MARIADB_TAG=10.3-3.8.2
22+
#MARIADB_TAG=10.2-3.8.2
23+
#MARIADB_TAG=10.1-3.8.2
24+
25+
### --- VANILLA DRUPAL ----
26+
27+
DRUPAL_TAG=8-4.17.12
28+
#DRUPAL_TAG=7-4.17.12
29+
30+
### --- PHP ----
31+
32+
# Linux (uid 1000 gid 1000)
33+
34+
#PHP_TAG=7.3-dev-4.15.8
35+
#PHP_TAG=7.2-dev-4.15.8
36+
#PHP_TAG=7.4-dev-4.15.8
37+
38+
# macOS (uid 501 gid 20)
39+
40+
#PHP_TAG=7.3-dev-macos-4.15.8
41+
#PHP_TAG=7.2-dev-macos-4.15.8
42+
PHP_TAG=7.4-dev-macos-4.15.8
43+
44+
### --- NGINX ----
45+
46+
NGINX_TAG=1.17-5.8.14
47+
#NGINX_TAG=1.16-5.8.14
48+
49+
NGINX_VHOST_PRESET=drupal8
50+
#NGINX_VHOST_PRESET=drupal7
51+
#NGINX_VHOST_PRESET=drupal6
52+
53+
### --- SOLR ---
54+
55+
SOLR_CONFIG_SET="search_api_solr_8.x-3.2"
56+
#SOLR_CONFIG_SET="search_api_solr_8.x-2.7"
57+
#SOLR_CONFIG_SET="search_api_solr_8.x-1.2"
58+
#SOLR_CONFIG_SET="search_api_solr_7.x-1.14"
59+
60+
SOLR_TAG=8-4.5.2
61+
#SOLR_TAG=7-4.5.2
62+
#SOLR_TAG=6-4.5.2
63+
#SOLR_TAG=5-4.5.2
64+
65+
### --- ELASTICSEARCH ---
66+
67+
ELASTICSEARCH_TAG=7-5.4.2
68+
#ELASTICSEARCH_TAG=6-5.4.2
69+
70+
### --- KIBANA ---
71+
72+
KIBANA_TAG=7-5.4.2
73+
#KIBANA_TAG=6-5.4.2
74+
75+
### --- REDIS ---
76+
77+
REDIS_TAG=5-3.3.0
78+
#REDIS_TAG=6-3.3.0
79+
80+
### --- NODE ---
81+
82+
NODE_TAG=12-dev-0.34.5
83+
#NODE_TAG=10-dev-0.34.5
84+
#NODE_TAG=8-dev-0.34.5
85+
86+
### --- VARNISH ---
87+
88+
VARNISH_TAG=6.0-4.4.6
89+
#VARNISH_TAG=4.1-4.4.6
90+
91+
### --- POSTGRESQL ----
92+
93+
POSTGRES_TAG=12-1.9.3
94+
#POSTGRES_TAG=11-1.9.3
95+
#POSTGRES_TAG=10-1.9.3
96+
#POSTGRES_TAG=9.6-1.9.3
97+
#POSTGRES_TAG=9.5-1.9.3
98+
#POSTGRES_TAG=9.4-1.9.3
99+
100+
### OTHERS
101+
102+
ADMINER_TAG=4-3.9.11
103+
APACHE_TAG=2.4-4.2.6
104+
ATHENAPDF_TAG=2.10.0
105+
DRUPAL_NODE_TAG=1.0-2.0.0
106+
MEMCACHED_TAG=1-2.5.5
107+
OPENSMTPD_TAG=6.0-1.6.5
108+
RSYSLOG_TAG=latest
109+
SELENIUM_CHROME_TAG=3.141
110+
WEBGRIND_TAG=1-1.15.5
111+
XHPROF_TAG=2.2.4
112+
113+
#FRONTEND
114+
FRONTEND_TAG=13

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
frontend/node_modules
2+
3+
backend/web/core
4+
backend/web/modules/contrib
5+
backend/vendo
6+
7+
.idea
8+
.env
9+
.DS_Store

Makefile

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
include .env
2+
3+
default: up
4+
5+
COMPOSER_ROOT ?= /var/www/html
6+
DRUPAL_ROOT ?= /var/www/html/web
7+
8+
## help : Print commands help.
9+
.PHONY: help
10+
ifneq (,$(wildcard docker.mk))
11+
help : docker.mk
12+
@sed -n 's/^##//p' $<
13+
else
14+
help : Makefile
15+
@sed -n 's/^##//p' $<
16+
endif
17+
18+
## up : Start up containers.
19+
.PHONY: up
20+
up:
21+
@echo "Starting up containers for $(PROJECT_NAME)..."
22+
docker-compose pull
23+
docker-compose up -d --remove-orphans
24+
25+
## down : Stop containers.
26+
.PHONY: down
27+
down: stop
28+
29+
## start : Start containers without updating.
30+
.PHONY: start
31+
start:
32+
@echo "Starting containers for $(PROJECT_NAME) from where you left off..."
33+
@docker-compose start
34+
35+
## stop : Stop containers.
36+
.PHONY: stop
37+
stop:
38+
@echo "Stopping containers for $(PROJECT_NAME)..."
39+
@docker-compose stop
40+
41+
## prune : Remove containers and their volumes.
42+
## You can optionally pass an argument with the service name to prune single container
43+
## prune mariadb : Prune `mariadb` container and remove its volumes.
44+
## prune mariadb solr : Prune `mariadb` and `solr` containers and remove their volumes.
45+
.PHONY: prune
46+
prune:
47+
@echo "Removing containers for $(PROJECT_NAME)..."
48+
@docker-compose down -v $(filter-out $@,$(MAKECMDGOALS))
49+
50+
## ps : List running containers.
51+
.PHONY: ps
52+
ps:
53+
@docker ps --filter name='$(PROJECT_NAME)*'
54+
55+
## shell : Access `php` container via shell.
56+
.PHONY: shell
57+
shell:
58+
docker exec -ti -e COLUMNS=$(shell tput cols) -e LINES=$(shell tput lines) $(shell docker ps --filter name='$(PROJECT_NAME)_php' --format "{{ .ID }}") sh
59+
60+
## composer : Executes `composer` command in a specified `COMPOSER_ROOT` directory (default is `/var/www/html`).
61+
## To use "--flag" arguments include them in quotation marks.
62+
## For example: make composer "update drupal/core --with-dependencies"
63+
.PHONY: composer
64+
composer:
65+
docker exec $(shell docker ps --filter name='^/$(PROJECT_NAME)_php' --format "{{ .ID }}") composer --working-dir=$(COMPOSER_ROOT) $(filter-out $@,$(MAKECMDGOALS))
66+
67+
## drush : Executes `drush` command in a specified `DRUPAL_ROOT` directory (default is `/var/www/html/web`).
68+
## To use "--flag" arguments include them in quotation marks.
69+
## For example: make drush "watchdog:show --type=cron"
70+
.PHONY: drush
71+
drush:
72+
docker exec $(shell docker ps --filter name='^/$(PROJECT_NAME)_php' --format "{{ .ID }}") drush -r $(DRUPAL_ROOT) $(filter-out $@,$(MAKECMDGOALS))
73+
74+
## logs : View containers logs.
75+
## You can optinally pass an argument with the service name to limit logs
76+
## logs php : View `php` container logs.
77+
## logs nginx php : View `nginx` and `php` containers logs.
78+
.PHONY: logs
79+
logs:
80+
@docker-compose logs -f $(filter-out $@,$(MAKECMDGOALS))
81+
82+
# https://stackoverflow.com/a/6273809/1826109
83+
%:
84+
@:

backend/.env.example

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# Copy and rename this file to .env at root of this project.
3+
#
4+
5+
# A common use case is to supply database creds via the environment. Edit settings.php
6+
# like so:
7+
#
8+
# $databases['default']['default'] = [
9+
# 'database' => getenv('MYSQL_DATABASE'),
10+
# 'driver' => 'mysql',
11+
# 'host' => getenv('MYSQL_HOSTNAME'),
12+
# 'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
13+
# 'password' => getenv('MYSQL_PASSWORD'),
14+
# 'port' => getenv('MYSQL_PORT'),
15+
# 'prefix' => '',
16+
# 'username' => getenv('MYSQL_USER'),
17+
# ];
18+
#
19+
# Uncomment and populate as needed.
20+
# MYSQL_DATABASE=
21+
# MYSQL_HOSTNAME=
22+
# MYSQL_PASSWORD=
23+
# MYSQL_PORT=
24+
# MYSQL_USER=
25+
26+
# Another common use case is to set Drush's --uri via environment.
27+
# DRUSH_OPTIONS_URI=http://example.com

backend/.gitignore

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Ignore directories generated by Composer
2+
/drush/contrib/
3+
/vendor/
4+
/web/core/
5+
/web/modules/contrib/
6+
/web/themes/contrib/
7+
/web/profiles/contrib/
8+
/web/libraries/
9+
10+
# Ignore sensitive information
11+
/web/sites/*/settings.php
12+
/web/sites/*/settings.local.php
13+
14+
# Ignore Drupal's file directory
15+
/web/sites/*/files/
16+
17+
# Ignore SimpleTest multi-site environment.
18+
/web/sites/simpletest
19+
20+
# Ignore files generated by PhpStorm
21+
/.idea/
22+
23+
# Ignore .env files as they are personal
24+
/.env
25+
/.editorconfig
26+
/.gitattributes

backend/.travis.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
language: php
2+
dist: trusty
3+
sudo: false
4+
5+
php:
6+
- 7.0
7+
- 7.1
8+
- 7.2
9+
- 7.3
10+
11+
env:
12+
global:
13+
- SIMPLETEST_DB=sqlite://tmp/site.sqlite
14+
- SIMPLETEST_BASE_URL="http://127.0.0.1:8080"
15+
matrix:
16+
- RELEASE=stable COMPOSER_CHANNEL=stable
17+
- RELEASE=dev COMPOSER_CHANNEL=stable
18+
- RELEASE=stable COMPOSER_CHANNEL=snapshot
19+
20+
before_install:
21+
- echo 'sendmail_path = /bin/true' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
22+
- phpenv config-rm xdebug.ini
23+
- composer --verbose self-update --$COMPOSER_CHANNEL
24+
- composer --version
25+
26+
install:
27+
- composer --verbose validate
28+
- composer --verbose install
29+
30+
script:
31+
- if [[ $RELEASE = dev ]]; then composer --verbose remove --no-update drupal/console; fi;
32+
- if [[ $RELEASE = dev ]]; then composer --verbose require --no-update drupal/core:8.8.x-dev; composer --verbose require --no-update --dev drupal/core-dev:8.8.x-dev; fi;
33+
- if [[ $RELEASE = dev ]]; then composer --verbose update; fi;
34+
- ./vendor/bin/drush site-install --verbose --yes --db-url=sqlite://tmp/site.sqlite
35+
- ./vendor/bin/drush runserver $SIMPLETEST_BASE_URL &
36+
- until curl -s $SIMPLETEST_BASE_URL; do true; done > /dev/null
37+
# Run a single unit test to verfiy the testing setup.
38+
- ./vendor/bin/phpunit -c ./web/core ./web/core/modules/system/tests/src/Unit/SystemRequirementsTest.php
39+
- ./vendor/bin/drush
40+
- if [[ $RELEASE = stable ]]; then ./vendor/bin/drupal; fi;

0 commit comments

Comments
 (0)