This repository has been archived by the owner on Jul 19, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
146 lines (133 loc) · 5.64 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
##
# https://docs.docker.com/compose/compose-file/
#
version: "3.7"
services:
##
# As of 2020-04-18, Pantheon installs MariaDB the following database:
#
# Server version: 5.5.5-10.0.23-MariaDB-log MariaDB Server
#
# collation_database utf8_general_ci
# collation_server utf8_general_ci
#
# so we mimic that setup here.
#
mysql:
##
# * https://hub.docker.com/_/mariadb
# * Pantheon uses MariaDB so we do too. As of 2020-04-18, Pantheon
# installs MariaDB:
#
# Server version: 5.5.5-10.0.23-MariaDB-log MariaDB
#
# so we try to match that as closely as we can.
#
image: "mariadb:10"
ports:
# host:container
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: drupal
MYSQL_DATABASE: drupal
volumes:
##
# The database image creates and mounts (at /var/lib/mysql) an
# anonymous volume by default. We override this with a named volume
# because a volume with a sensible name is easier to manage and
# clean up later on.
#
- "mysql_data:/var/lib/mysql"
##
# * The MySQL container will execute files with extensions .sh,
# .sql and .sql.gz that are found in `/docker-entrypoint-initdb.d`.
# * Files will be executed in alphabetical order.
# * SQL files will be imported by default to the database specified
# by the MYSQL_DATABASE variable.
# * You can easily populate your mysql services by mounting a SQL
# dump into that directory and provide custom images with
# contributed data.
#
# path-on-host:absolute-path-on-container
# - "./drupal-db-dump.sql:/docker-entrypoint-initdb.d/dump.sql"
##
# Mailhog is a service that captures email sent over STMP and
# displays it to the developer and keeps it from going out.
# Use the browser at http://localhost:8025
# You application must send email over SMTP over localhost:1025
# Further necessary configuration is commented out in `/root/setup.sh`
##
# mailhog:
# image: "mailhog/mailhog"
# ports:
# # host:container
# - "1025:1025"
# - "8025:8025"
drupal:
build:
context: .
dockerfile: dev/Dockerfile.dev.drupal
cache_from:
- docker.pkg.github.com/ackama/dpc-user-management-module/drupal-dev:latest
ports:
# host:container
- "8080:80"
depends_on:
- mysql
environment:
##
# Give composer all the memory we have to stop it dying annoyingly sometimes
#
COMPOSER_MEMORY_LIMIT: "-1"
##
# These are the credentials for the Drupal admin user which
# will be created during site installation.
#
DRUPAL_ADMIN_USERNAME: admin
DRUPAL_ADMIN_PASSWORD: admin
##
# These variables are used to generate a ~/.my.cnf configuration
# file for the MySQL client installed in this container so you can
# connect to the DB by just running `mysql` without any args.
#
MYSQL_CLIENT_HOST: mysql
MYSQL_CLIENT_USER: root
MYSQL_CLIENT_PASSWORD: drupal
MYSQL_CLIENT_DATABASE: drupal
volumes:
##
# We mount the module files only the files and specific directories
# we will want to edit on the host.
# We assume that all commands will be run within the container.
#
- ./composer.json:/var/www/composer.json:cached
- ./composer.lock:/var/www/composer.lock:cached
- ./phpunit.xml:/var/www/phpunit.xml:cached
##
# Adds a named volume under the module's root where ./html/ and ./dev/ should be placed
# in order to prevent recursion happening when discovering paths:
# ./html/ is a child of ./ and ./ is mounted under ./html/modules/custom/...
# ./dev/ is a child of ./ and ./ is be mounted under ./dev/themes/custom/ and ./dev/themes/custom/
- prevent_recursion_html:/var/www/html/modules/custom/dpc_user_management/html:cached
- prevent_recursion_dev:/var/www/html/modules/custom/dpc_user_management/dev:cached
- prevent_recursion_vendor:/var/www/html/modules/custom/dpc_user_management/vendor:cached
- prevent_recursion_node_modules:/var/www/html/modules/custom/dpc_user_management/node_modules:cached
##
# Customise local development settings
- ./dev/sites/default/settings.local.php:/var/www/html/sites/default/settings.local.php:cached
- ./dev/config/services/drupal/root/setup.sh:/root/setup.sh:cached
- ./dev/config/services/drupal/root/run-ci.sh:/root/run-ci.sh:cached
- ./dev/config/services/drupal/etc/nginx/nginx.conf:/etc/nginx/nginx.conf:cached
##
# Module Code - This mounts out module's codebase into the container
- ./:/var/www/html/modules/custom/dpc_user_management:cached
##
# Third Party Custom Modules and Themes
# - ./dev/modules/custom:/var/www/html/modules/custom:cached
# - ./dev/themes/custom:/var/www/html/themes/custom:cached
volumes:
mysql_data:
prevent_recursion_html:
prevent_recursion_dev:
prevent_recursion_vendor:
prevent_recursion_node_modules: