-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
175 lines (163 loc) · 4.42 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
volumes:
node_modules: ~
dist: ~
php-socket:
mariadb_data: ~
minio_storage: ~
local_ssh: ~
services:
php-fpm:
build:
context: .
target: dev
volumes:
- dist:/var/www/html/public/app/themes/justice/dist
- .:/var/www/html
- php-socket:/sock
env_file:
- .env
depends_on:
- mariadb
- minio
nginx:
build:
context: .
dockerfile: Dockerfile
target: nginx-dev
volumes:
- dist:/var/www/html/public/app/themes/justice/dist
- php-socket:/sock
### Deploy scripts
- ./deploy/config/local/php-fpm.conf:/etc/nginx/php-fpm.conf
- ./deploy/config/local/server.conf:/etc/nginx/conf.d/default.conf
- ./deploy/config/nginx.conf:/etc/nginx/nginx.conf
- ./deploy/config/auth-request.conf:/etc/nginx/auth-request.conf
- ./deploy/config/php-fpm-auth.conf:/etc/nginx/php-fpm-auth.conf
- ./deploy/config/redirects.conf:/etc/nginx/redirects.conf
### Assets
- ./public/app/plugins:/var/www/html/public/app/plugins
- ./public/app/themes/justice/screenshot.png:/var/www/html/public/app/themes/justice/screenshot.png
- ./public/app/themes/justice/error-pages:/var/www/html/public/app/themes/justice/error-pages
- ./public/wp:/var/www/html/public/wp
- ./public/index.php:/var/www/html/public/index.php
environment:
VIRTUAL_HOST: ${SERVER_NAME}
VIRTUAL_PORT: 8080
SERVER_NAME: justice.docker
ports:
- "8080:8080"
depends_on:
- node
- php-fpm
node:
image: node:20
working_dir: /node
entrypoint: make
command: node-assets
volumes:
- node_modules:/node/node_modules
- dist:/node/dist
- ./Makefile:/node/Makefile
- ./public/app/themes/justice/src:/node/src
- ./public/app/themes/justice/jsconfig.json:/node/jsconfig.json
- ./public/app/themes/justice/package.json:/node/package.json
- ./public/app/themes/justice/package-lock.json:/node/package-lock.json
- ./public/app/themes/justice/webpack.mix.js:/node/webpack.mix.js
jekyll:
build:
target: jekyll-dev
entrypoint: make
command: jekyll-serve
volumes:
- ./Makefile:/home/Makefile
- ./.github/pages:/home/pages
ports:
- "4000:4000"
- "35729:35729"
environment:
VIRTUAL_HOST: pages.${SERVER_NAME}
VIRTUAL_PORT: 4000
mariadb:
image: mariadb:10
healthcheck:
test: [ "CMD-SHELL", "bash", "-c", "echo > /dev/tcp/localhost/3306" ]
interval: 1s
volumes:
- mariadb_data:/var/lib/mysql
environment:
MYSQL_RANDOM_ROOT_PASSWORD: "true"
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
MYSQL_DATABASE: ${DB_NAME}
minio:
image: minio/minio
ports:
- "9000:9000"
- "9001:9001"
volumes:
- minio_storage:/data
environment:
MINIO_ROOT_USER: ${AWS_ACCESS_KEY_ID}
MINIO_ROOT_PASSWORD: ${AWS_SECRET_ACCESS_KEY}
VIRTUAL_HOST: minio.${SERVER_NAME}
VIRTUAL_PORT: 9000
command: server --console-address ":9001" /data
healthcheck:
test: timeout 5s bash -c ':> /dev/tcp/127.0.0.1/9000' || exit 1
start_period: 5s
interval: 10s
timeout: 5s
retries: 2
minio-init:
image: minio/mc
depends_on:
- minio
entrypoint: |
/bin/sh -c "
mc config host add justice-gov-uk http://minio:9000 ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY}
mc mb justice-gov-uk/${S3_BUCKET_NAME}
mc anonymous set download justice-gov-uk/${S3_BUCKET_NAME};
exit 0
"
cdn:
image: caddy:2.7.6-alpine
volumes:
- ./deploy/config/local/Caddyfile:/etc/caddy/Caddyfile
environment:
S3_BUCKET_NAME: ${S3_BUCKET_NAME}
VIRTUAL_HOST: cdn.${SERVER_NAME}
VIRTUAL_PORT: 2019
depends_on:
- minio
phpmyadmin:
image: phpmyadmin
environment:
- PMA_HOST=mariadb
depends_on:
- mariadb
ports:
- "9191:80"
links:
- mariadb
local-ssh:
build:
context: .
target: local-ssh
args:
LOCAL_SSH_PASSWORD: ${LOCAL_SSH_PASSWORD}
volumes:
- .:/var/www/html
- local_ssh:/home/ssh-user/.ssh
env_file:
- .env
environment:
VIRTUAL_HOST: ssh.${SERVER_NAME}
VIRTUAL_PORT: 2222
ports:
- 2222:22
profiles:
- local-ssh
redis:
image: 'bitnami/redis:latest'
environment:
- ALLOW_EMPTY_PASSWORD=yes