-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
194 lines (187 loc) · 6.81 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
187
188
189
190
191
192
193
194
version: "3.7"
#================================================================================================
# NETWORK SETUP
#================================================================================================
networks:
devopscorner_net:
name: devopscorner_net
driver: bridge
ipam:
config:
- subnet: 172.150.150.0/16
#================================================================================================
# VOLUME SETUP
#================================================================================================
volumes:
vol_adminer:
driver: ${VOLUMES_DRIVER:-local}
driver_opts:
o: bind
type: none
device: ${SESSION_ADMINER:-/opt/data/docker/session/adminer}
vol_portainer:
driver: ${VOLUMES_DRIVER:-local}
driver_opts:
o: bind
type: none
device: ${DATA_PORTAINER:-/opt/data/docker/portainer2.9}
vol_mariadb:
driver: ${VOLUMES_DRIVER:-local}
driver_opts:
o: bind
type: none
device: ${DATA_MARIADB:-/opt/data/docker/mariadb10.5}
vol_laravel:
driver: ${VOLUMES_DRIVER:-local}
driver_opts:
o: bind
type: none
device: ${DATA_LARAVEL:-/opt/data/docker/laravel}
vol_nginx:
driver: ${VOLUMES_DRIVER:-local}
driver_opts:
o: bind
type: none
device: ${DATA_NGINX:-/opt/data/docker/nginx-alpine}
services:
#================================================================================================
# ADMINER
#================================================================================================
adminer:
image: dockerframework/adminer:${ADMINER_VERSION:-4.8.1}
container_name: ${CONTAINER_ADMINER:-devopscorner_adminer}
restart: always
ports:
- "${PORT_ADMINER:-5210}:8080"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
- vol_adminer:/sessions
environment:
- TZ="Asia/Jakarta"
- ADMINER_VERSION=${ADMINER_VERSION:-4.8.1}
- INSTALL_MSSQL=${INSTALL_MSSQL:-false}
privileged: true
networks:
devopscorner_net:
ipv4_address: ${CONTAINER_IP_ADMINER:-172.150.150.200}
#================================================================================================
# PORTAINER
#================================================================================================
portainer:
image: dockerframework/portainer:${PORTAINER_VERSION:-2.9.0}
container_name: ${CONTAINER_PORTAINER:-devopscorner_portainer}
restart: always
hostname: myportainer
ports:
- "${PORT_PORTAINER:-5213}:9000"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
- vol_portainer:/data
environment:
- PORTAINER_TEMPLATE=generic
- PORTAINER_VERSION=${PORTAINER_VERSION:-2.9.0}
privileged: true
networks:
devopscorner_net:
ipv4_address: ${CONTAINER_IP_PORTAINER:-172.150.150.201}
#================================================================================================
# LARAVEL
#================================================================================================
laravel:
# image: devopscorner/laravel:${LARAVEL_VERSION:-latest}
build:
context: .
dockerfile: Dockerfile
container_name: ${CONTAINER_LARAVEL:-devopscorner_laravel}
links:
- mariadb
restart: always
hostname: mylaravel
ports:
- "${PORT_LARAVEL:-8000}:9000"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
environment:
- TZ="Asia/Jakarta"
- PHP_VERSION=${PHP_VERSION:-8.1}
- APP_KEY="base64:KvkVVCKALENqUruV8z6Lf85poviBolKzDxS+swRxxDk="
- APP_ENV=local
- APP_DEBUG=true
- DB_PORT=${MARIADB_PORT:-3306}
- DB_HOST=${MARIADB_HOST:-mariadb}
- DB_DATABASE=${MARIADB_DATABASE:-laravel_dev}
- DB_USERNAME=${MARIADB_USER:-laravel_user}
- DB_PASSWORD=${MARIADB_PASSWORD:-secretpassword}
healthcheck:
test: "${DOCKER_HEALTHCHECK_LARAVEL:-curl localhost:8000}"
interval: "60s"
timeout: "3s"
start_period: "5s"
retries: 5
privileged: true
tty: true
networks:
devopscorner_net:
ipv4_address: ${CONTAINER_IP_LARAVEL:-172.150.150.205}
#================================================================================================
# MARIADB
#================================================================================================
mariadb:
image: mariadb:${MARIADB_VERSION:-10.5.12}
# build:
# context: ./compose/docker/ubuntu-mariadb
# dockerfile: Dockerfile
container_name: ${CONTAINER_MARIADB:-devopscorner_mariadb}
restart: always
hostname: mymariadb
ports:
- "${PORT_MARIADB:-3306}:3306"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
- vol_mariadb:/var/lib/mysql
- ./compose/docker/ubuntu-mariadb/rootfs/etc/my.cnf:/etc/my.cnf
- ./compose/docker/ubuntu-mariadb/rootfs/etc/my.cnf.d/mariadb-server.cnf:/etc/my.cnf.d/mariadb-server.cnf
environment:
- ENV=local
- TZ="Asia/Jakarta"
- MYSQL_PROFILE=my-medium
- MYSQL_ROOT_PASSWORD=${MARIADB_ROOT_PASSWORD:-secretpassword}
- MYSQL_ROOT_HOST=${MARIADB_ROOT_HOST:-127.0.0.1}
- MYSQL_HOST=${MARIADB_HOST:-127.0.0.1}
- MYSQL_DATABASE=${MARIADB_DATABASE:-laravel_dev}
- MYSQL_USER=${MARIADB_USER:-laravel_user}
- MYSQL_PASSWORD=${MARIADB_PASSWORD:-secretpassword}
# - SKIP_INNODB=1
privileged: true
tty: true
networks:
devopscorner_net:
ipv4_address: ${CONTAINER_IP_MARIADB:-172.150.150.203}
#================================================================================================
# NGINX ALPINE
#================================================================================================
nginx:
image: devopscorner/cicd:${CICD_VERSION:-1.23-alpine}
# image: nginx:${NGINX_VERSION:-1.23-alpine}
container_name: ${CONTAINER_NGINX_ALPINE:-devopscorner_nginx}
restart: always
links:
- laravel
ports:
- "${PORT_NGINX:-5250}:80"
volumes:
# - /etc/localtime:/etc/localtime:ro ## Do not use it in mac
- /var/run/docker.sock:/var/run/docker.sock ## Do not use it in k8s
environment:
- TZ="Asia/Jakarta"
- ALPINE_VERSION=${ALPINE_VERSION:-3.16}
- NGINX_VERSION=${NGINX_VERSION:-1.23}
privileged: true
tty: true
networks:
devopscorner_net:
ipv4_address: ${CONTAINER_IP_NGINX:-172.150.150.213}