-
Notifications
You must be signed in to change notification settings - Fork 17
/
compose.yaml
154 lines (144 loc) · 4.86 KB
/
compose.yaml
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
services:
nginx:
image: ${COMPOSE_PROJECT_NAME}-nginx:latest
build:
context: ./docker/
args:
BUILD_ARGUMENT_ENV: dev
dockerfile: ./nginx/Dockerfile
container_name: ${COMPOSE_PROJECT_NAME}-nginx
restart: always
ports:
- "${WEB_PORT_HTTP}:80"
- "${WEB_PORT_SSL}:443"
volumes:
- ./:/var/www/html:ro,cached
depends_on:
- symfony
networks:
- symfony
symfony: &symfony-template
image: ${COMPOSE_PROJECT_NAME}-symfony:latest
build:
context: .
args:
BUILD_ARGUMENT_ENV: dev
HOST_UID: ${HOST_UID}
HOST_GID: ${HOST_GID}
XDEBUG_CONFIG: ${XDEBUG_CONFIG}
XDEBUG_VERSION: ${XDEBUG_VERSION}
dockerfile: ./Dockerfile
container_name: ${COMPOSE_PROJECT_NAME}-symfony
volumes:
- ./:/var/www/html:cached
depends_on:
- mysql
- rabbitmq
- elasticsearch
- redis
- mail
networks:
- symfony
### Cron tasks, RabbitMQ consumers
supervisord:
<<: *symfony-template
container_name: ${COMPOSE_PROJECT_NAME}-supervisord
expose: [ ]
command: [ "/usr/bin/supervisord" ]
mysql:
image: mysql:${MYSQL_VERSION}
platform: linux/x86_64
container_name: ${COMPOSE_PROJECT_NAME}-mysql
command: --innodb-use-native-aio=${INNODB_USE_NATIVE_AIO:-1} --sql_mode=${SQL_MODE:-"ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"}
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
MYSQL_DATABASE: symfony
ports:
- "${MYSQL_PORT}:3306"
volumes:
- ./var/mysql-data:/var/lib/mysql:delegated
- ./docker/dev/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
networks:
- symfony
rabbitmq:
image: ${COMPOSE_PROJECT_NAME}-rabbitmq
build:
context: ./docker/rabbitmq/
dockerfile: ./Dockerfile
container_name: ${COMPOSE_PROJECT_NAME}-rabbitmq
hostname: rabbitmq
environment:
RABBITMQ_ERLANG_COOKIE: ${RABBITMQ_ERLANG_COOKIE}
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASS}
RABBITMQ_DEFAULT_VHOST: /
ports:
- "${RABBITMQ_MANAGEMENT_PORT}:15672"
volumes:
- ./var/rabbitmq:/var/lib/rabbitmq:delegated
networks:
- symfony
elasticsearch:
image: ${COMPOSE_PROJECT_NAME}-elasticsearch
build:
context: ./docker/
args:
ELK_VERSION: ${ELK_VERSION}
dockerfile: ./elasticsearch/Dockerfile
container_name: ${COMPOSE_PROJECT_NAME}-elasticsearch
environment:
ES_JAVA_OPTS: "-Xmx1024m -Xms1024m"
ELASTIC_USERNAME: ${ELASTICSEARCH_USERNAME}
ELASTIC_PASSWORD: ${ELASTICSEARCH_PASSWORD}
# Use single node discovery in order to disable production mode and avoid bootstrap checks
# see https://www.elastic.co/guide/en/elasticsearch/reference/current/bootstrap-checks.html
discovery.type: single-node
ports:
- "${ELASTIC_HTTP_PORT}:9200"
- "${ELASTIC_TRANSPORT_PORT}:9300"
volumes:
- ./docker/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml:ro
- ./var/elasticsearch-data:/usr/share/elasticsearch/data:delegated
networks:
- symfony
kibana:
image: ${COMPOSE_PROJECT_NAME}-kibana
platform: linux/x86_64
build:
context: ./docker/
args:
ELK_VERSION: ${ELK_VERSION}
dockerfile: ./kibana/Dockerfile
container_name: ${COMPOSE_PROJECT_NAME}-kibana
ports:
- "${KIBANA_PORT}:5601"
volumes:
- ./docker/dev/kibana.yml:/usr/share/kibana/config/kibana.yml:ro
depends_on:
- elasticsearch
networks:
- symfony
redis:
image: ${COMPOSE_PROJECT_NAME}-redis
container_name: ${COMPOSE_PROJECT_NAME}-redis
build:
context: ./docker/redis
restart: always
ports:
- "${REDIS_PORT}:6379"
volumes:
- ./var/redis:/data:delegated
networks:
- symfony
mail:
image: axllent/mailpit:latest
container_name: ${COMPOSE_PROJECT_NAME}-mail
restart: always
ports:
- "8025:8025"
- "1025:1025"
networks:
- symfony
networks:
symfony:
name: symfony