-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdocker-compose.yml
79 lines (75 loc) · 2.71 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
---
services:
# We are splitting Nginx and Drupal, see
# https://blog.dcycle.com/blog/2022-03-25/php-apache-different-containers/
webserver:
build:
context: .
dockerfile: Dockerfile-nginx-only
environment:
# The virtual host is used when we want to access our site via an
# Nginx Proxy locally; and is required by the script
# ./scripts/https-deploy.sh.
# See https://blog.dcycle.com/blog/2018-10-27 for details.
# See also https://blog.dcycle.com/blog/7f3ea9e1/
# See also https://blog.dcycle.com/blog/170a6078/
- VIRTUAL_HOST=${VIRTUAL_HOST}
- LETSENCRYPT_HOST=${VIRTUAL_HOST}
- LETSENCRYPT_EMAIL="letsencrypt@${VIRTUAL_HOST}"
volumes:
- "./do-not-commit:/do-not-commit:rw"
- "drupal-files:/var/www/html/sites/default/files:rw"
- "drupal-themes-contrib:/var/www/html/themes/contrib"
- "drupal-modules-contrib:/var/www/html/modules/contrib"
depends_on:
- drupal
ports:
- "80"
# We are splitting Nginx and Drupal, see
# https://blog.dcycle.com/blog/2022-03-25/php-apache-different-containers/
drupal:
build:
context: .
dockerfile: Dockerfile-drupal-dev
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
- HASH_SALT=${HASH_SALT}
volumes:
- "./do-not-commit:/do-not-commit:rw"
- "drupal-files:/var/www/html/sites/default/files:rw"
- "drupal-private-files:/drupal-private-files:rw"
- "./drupal/settings/local-settings:/local-settings"
- "drupal-themes-contrib:/var/www/html/themes/contrib"
- "drupal-modules-contrib:/var/www/html/modules/contrib"
depends_on:
- mysql
working_dir: /var/www/html
# Database server
mysql:
image: mariadb
environment:
MYSQL_DATABASE: drupal
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_ALLOW_EMPTY_PASSWORD: 'no'
volumes:
- "mysql:/var/lib/mysql"
# Specifying the network name makes it predictable on all environments,
# for example when running ./scripts/migrate-all.sh, or when running browser
# tests on a CI environment, or any other tasks which requires external
# docker containers to connect to our network.
# This network (starterkit_drupalsite_default) has been previously created in
# ./scripts/deploy.sh
# See https://github.com/docker/compose/issues/3736.
networks:
default:
name: starterkit_drupalsite_default
external: true
volumes:
mysql:
drupal-files:
# Nginx and Drupal containers need to have the exact same files, otherwise
# things like css files in contrib modules or themes will not be visible.
# In order to achieve this we share these via volumes.
drupal-themes-contrib:
drupal-modules-contrib:
drupal-private-files: