-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
150 lines (141 loc) · 4.06 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
version: '3'
networks:
traefik-net:
external: true
services:
# Laravel Application
# php-app: # If you update the service name you have to change in the nginx default.conf file
# build:
# context: ./project
# dockerfile: DockerfileNginx
# container_name: ${CONTAINER_PREFIX}-app
# working_dir: /var/www/html
# volumes:
# - ${CODE_PATH}:/var/www/html
# - ../jmi/.env:/var/www/html/.env
# - ../jmi/packages/:/var/packages
# networks:
# - traefik-net
php-app-apache: # Uncoment this if you want to use apache and comment the above service and the nginx service
build:
context: ./project
dockerfile: DockerfileApache
args:
uid: ${UID:-1000}
container_name: ${CONTAINER_PREFIX}-app
working_dir: /var/www/html
user: devuser
volumes:
- ${CODE_PATH}:/var/www/html
networks:
- traefik-net
labels:
- "traefik.http.routers.php-app-apache.rule=Host(`${APP_NAME}.${HOST_PREFIX}`)"
# Nginx
# nginx:
# image: nginx:latest
# container_name: ${CONTAINER_PREFIX}-nginx
# ports:
# - "8001:8001"
# volumes:
# - ./nginx/default:/etc/nginx/conf.d/default.conf
# - ${CODE_PATH}:/var/www/html
# networks:
# - traefik-net
# labels:
# - "traefik.http.routers.nginx.rule=Host(`${APP_NAME}.${HOST_PREFIX}`)"
# - "traefik.http.services.nginx.loadbalancer.server.port=8001"
# MySQL Database Primary
mysql:
image: mysql:8.0
container_name: ${CONTAINER_PREFIX}-mysql
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' # Allow root login without password
MYSQL_ROOT_PASSWORD: '' # Empty root password
MYSQL_DATABASE: ${DB_NAME}
MYSQL_USER: ${DB_USER}
MYSQL_PASSWORD: ${DB_PASSWORD}
networks:
- traefik-net
labels:
- "traefik.enable=false"
volumes:
- mysql_data:/var/lib/mysql
# Mysql database secondary
mysql-archive:
image: mysql:8.0
container_name: ${CONTAINER_PREFIX}-mysql-archive
environment:
MYSQL_ALLOW_EMPTY_PASSWORD: 'yes' # Allow root login without password
MYSQL_ROOT_PASSWORD: '' # Empty root password
MYSQL_DATABASE: ${DB_NAME_SECONDARY}
MYSQL_USER: ${DB_USER_SECONDARY}
MYSQL_PASSWORD: ${DB_PASSWORD}
networks:
- traefik-net
labels:
- "traefik.enable=false"
volumes:
- mysql_archive_data:/var/lib/mysql
# Redis Server
redis:
image: redis:alpine
container_name: ${CONTAINER_PREFIX}-redis
networks:
- traefik-net
labels:
- "traefik.enable=false"
volumes:
- redis_data:/data
# PHPMyAdmin Primary Database
phpmyadmin:
image: phpmyadmin/phpmyadmin
container_name: ${CONTAINER_PREFIX}-phpmyadmin
environment:
PMA_HOST: mysql
PMA_USER: ${DB_USER}
PMA_PASSWORD: ${DB_PASSWORD}
ports:
- "1234:80"
networks:
- traefik-net
labels:
- "traefik.http.routers.phpmyadmin.rule=Host(`phpmyadmin-${CONTAINER_PREFIX}.${HOST_PREFIX}`)"
volumes:
- phpmyadmin_data:/data
# PHPMyAdmin Secondary Database
phpmyadmin-archive:
image: phpmyadmin/phpmyadmin
container_name: ${CONTAINER_PREFIX}-phpmyadmin-archive
environment:
PMA_HOST: mysql-archive
PMA_USER: ${DB_USER_SECONDARY}
PMA_PASSWORD: ${DB_PASSWORD}
ports:
- "1235:80"
networks:
- traefik-net
labels:
- "traefik.http.routers.phpmyadmin-archive.rule=Host(`phpmyadmin-archive-${CONTAINER_PREFIX}.${HOST_PREFIX}`)"
volumes:
- phpmyadmin_data:/data
# MeiliSearch
meilisearch:
image: getmeili/meilisearch:v1.6
container_name: ${CONTAINER_PREFIX}-meilisearch
ports:
- 7700:7700
environment:
- MEILI_MASTER_KEY=${MEILI_MASTER_KEY}
volumes:
- ./meili_data:/data.ms # Mount volume for MeiliSearch data persistence
networks:
- traefik-net
labels:
- "traefik.http.routers.meilisearch.rule=Host(`meilisearch-${CONTAINER_PREFIX}.${HOST_PREFIX}`)"
volumes:
phpmyadmin_data:
redis_data:
mysql_data:
mysql_archive_data:
meili_data: