Skip to content

Commit 0b1d7e5

Browse files
Merge pull request #7 from alvinjohnsonso/docker-test-files
Drupal 8 and 9 docker files - added docker files for running a test environment
2 parents 155e510 + 6fea5b4 commit 0b1d7e5

File tree

7 files changed

+66
-0
lines changed

7 files changed

+66
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# exclude docker files from archive
2+
/docker export-ignore

docker/.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DRUPAL_IMAGE_VERSION=latest
2+
3+
COMPOSE_PROJECT_NAME=drupal-${DRUPAL_IMAGE_VERSION}

docker/README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
Drupal
2+
============
3+
Docker containers for Drupal
4+
5+
## Information
6+
- Drupal Versions: 8.8, 8.9, 9
7+
- MySQL Version: 5.7
8+
9+
## Pre-Requisites
10+
- install docker-compose [http://docs.docker.com/compose/install/](http://docs.docker.com/compose/install/)
11+
12+
## Usage
13+
Start the container:
14+
- ```docker-compose --env-file envs/<env-file> up```
15+
16+
Start the container in detach mode:
17+
- ```docker-compose --env-file envs/<env-file> up -d```
18+
19+
Stop the container:
20+
- ```docker-compose --env-file envs/<env-file> stop```
21+
22+
Destroy the container and start from scratch:
23+
- ```docker-compose --env-file envs/<env-file> down```
24+
- ```docker volume rm drupal-<volume-name>```
25+
- ex. ```docker volume rm drupal-latest_web_data drupal-latest_db_data```
26+
27+
## Plugin setup
28+
You can follow the instruction in [Drupal 8 Github Repo](https://github.com/tawk/tawk-drupal8) (Drupal 9 also works here since it is backwards compatible).

docker/docker-compose.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
version: '3.3'
2+
3+
services:
4+
db:
5+
image: mysql:5.7
6+
volumes:
7+
- db_data:/var/lib/mysql
8+
environment:
9+
MYSQL_ROOT_PASSWORD: somedrupal
10+
MYSQL_DATABASE: drupal
11+
MYSQL_USER: drupal
12+
MYSQL_PASSWORD: drupal
13+
14+
drupal:
15+
depends_on:
16+
- db
17+
image: drupal:${DRUPAL_IMAGE_VERSION}
18+
ports:
19+
- 8000:80
20+
volumes:
21+
- web_data:/var/www/html
22+
volumes:
23+
db_data:
24+
web_data:

docker/envs/drupal-88.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DRUPAL_IMAGE_VERSION=8.8-apache
2+
3+
COMPOSE_PROJECT_NAME=drupal-${DRUPAL_IMAGE_VERSION}

docker/envs/drupal-89.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DRUPAL_IMAGE_VERSION=8.9-apache
2+
3+
COMPOSE_PROJECT_NAME=drupal-${DRUPAL_IMAGE_VERSION}

docker/envs/drupal-9.env

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DRUPAL_IMAGE_VERSION=9-apache
2+
3+
COMPOSE_PROJECT_NAME=drupal-${DRUPAL_IMAGE_VERSION}

0 commit comments

Comments
 (0)