-
-
Notifications
You must be signed in to change notification settings - Fork 23
/
docker-compose.yml
186 lines (174 loc) · 4.85 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
176
177
178
179
180
181
182
183
184
185
186
services:
varnish:
container_name: ${NAMESPACE}_varnish
image: varnish:${VARNISH_VERSION}
tmpfs:
- /var/lib/varnish:exec
command: "-p default_keep=300"
env_file: .env
depends_on:
- nginx
ports:
- "80:80"
volumes:
- .docker/varnish/default.vcl:/etc/varnish/default.vcl:ro
nginx:
container_name: ${NAMESPACE}_nginx
image: nginx:${NGINX_VERSION}
depends_on:
- php
ports:
- "8080:8080"
env_file: .env
command: '/usr/sbin/nginx -g "daemon off; error_log /dev/stderr info;"'
networks:
default:
aliases:
- ${SHOPURI}
volumes:
- app_data:${WORKDIR_SERVER}:delegated
- .docker/nginx/config/nginx.conf:/etc/nginx/nginx.conf:ro
- .docker/nginx/config/default.conf:/etc/nginx/conf.d/default.conf:ro
php:
# build:
# context: ./.docker/php
# args:
# PHP_VERSION_SET: ${PHP_VERSION_SET}
# ACPU_VERSION: $ACPU_VERSION
# XDEBUG_VERSION: $XDEBUG_VERSION
# FIXUID_VERSION: $FIXUID_VERSION
# USER_PHP: $USER_PHP
# GROUP_PHP: $GROUP_PHP
container_name: ${NAMESPACE}_php
image: osioaliu/php:${PHP_VERSION_SET}
env_file: .env
sysctls:
net.core.somaxconn: 65536
depends_on:
db:
condition: service_healthy
redis_session:
condition: service_healthy
redis_cache:
condition: service_healthy
user: ${UID_GID}
restart: on-failure
entrypoint: [ "fixuid","docker-php-entrypoint" ]
command: [ "php-fpm" ]
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- db_socket:/var/run/mysqld
- app_data:${WORKDIR_SERVER}:delegated
- composer_cache:/home/www-data/.composer:delegated
- .docker/php/config/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini:ro
- .docker/php/config/php-ini-overrides.ini:/usr/local/etc/php/conf.d/php-ini-overrides.ini:ro
- .docker/php/config/zz-docker.conf:/usr/local/etc/php-fpm.d/zz-docker.conf:ro
db:
container_name: ${NAMESPACE}_db
image: mariadb:${MARIADB_VERSION}
env_file: .env
ports:
- ${MYSQL_PORT}:3306
healthcheck:
test: 'mysqladmin ping -h localhost -p${MYSQL_ROOT_PASSWORD}'
interval: 30s
timeout: 30s
retries: 3
volumes:
- db_socket:/var/run/mysqld
- db_data:/var/lib/mysql/
- .docker/mysql/db_dumps:/docker-entrypoint-initdb.d
- .docker/mysql/config/my.cnf:/etc/mysql/my.cnf
redis_session:
container_name: ${NAMESPACE}_redis_session
image: redis:${REDIS_VERSION}
env_file: .env
sysctls:
net.core.somaxconn: '1024'
entrypoint: redis-server
command: [ "/etc/redis/redis.conf", "--appendonly", "yes" ]
healthcheck:
test: 'redis-cli ping || exit 1'
interval: 30s
timeout: 30s
retries: 3
volumes:
- redis_socket_session:/run/redis/
- ./.docker/redis/redis.conf:/etc/redis/redis.conf:ro
redis_cache:
container_name: ${NAMESPACE}_redis_cache
image: redis:${REDIS_VERSION}
sysctls:
net.core.somaxconn: '1024'
entrypoint: redis-server
env_file: .env
command: [ "/etc/redis/redis.conf", "--appendonly", "yes" ]
healthcheck:
test: 'redis-cli ping || exit 1'
interval: 30s
timeout: 30s
retries: 3
volumes:
- redis_socket_cache:/run/redis/
- ./.docker/redis/redis.conf:/etc/redis/redis.conf:ro
opensearch:
container_name: ${NAMESPACE}_opensearch
image: markoshust/magento-opensearch:${OPENSEARCH_VERSION}
ports:
- "9200:9200"
- "9300:9300"
env_file: .env
environment:
- "discovery.type=single-node"
- "cluster.routing.allocation.disk.threshold_enabled=false"
- "index.blocks.read_only_allow_delete"
volumes:
- opensearch_data:/usr/share/opensearch/data
mailhog:
container_name: ${NAMESPACE}_mailhog
image: mailhog/mailhog:${MAILHOG_VERSION}
env_file: .env
ports:
- ${MAILHOG_EXTERNAL_PORT}:8025
# rabbitmq:
# container_name: ${NAMESPACE}_rabbitmq
# image: rabbitmq:${RABBITMQ_VERSION}
# environment:
# RABBITMQ_DEFAULT_USER: admin
# RABBITMQ_DEFAULT_PASS: admin2017
# ports:
# - "15672:15672"
# - "5672:5672"
# volumes:
# - rabbitmq_data:/var/lib/rabbitmq
# watchtower:
# container_name: ${NAMESPACE}_watchtower
# image: containrrr/watchtower
# volumes:
# - /var/run/docker.sock:/var/run/docker.sock
# environment:
# TZ: ${TZ}
# command: --interval 3600
volumes:
# rabbitmq_data:
opensearch_data:
redis_socket_cache:
redis_socket_session:
db_socket:
db_data:
app_data:
driver_opts:
type: none
o: bind
device: ${WORKDIR}
composer_cache:
driver_opts:
type: none
o: bind
device: ${HOME}/.composer
networks:
default:
ipam:
config:
- subnet: 172.19.0.0/16