1version: '3.8'
2services:
3#############################
4# MARIADB SERVIVICES
5#############################
6 db:
7 image: mariadb:latest
8 restart: always
9 healthcheck:
10 interval: 120ms
11 retries: 5
12 start_period: 60ms
13 test: |
14 touch /tmp/healthcheck.txt &&
15 mkdir /tmp/healthcheck &&
16 mv /tmp/healthcheck.txt /tmp/healthcheck &&
17 cd /tmp/healthcheck &&
18 echo "hello my docker container is working fine" >> healthcheck.txt &&
19 cat healthcheck.txt &&
20 rm healthcheck.txt &&
21 cd .. &&
22 rmdir /tmp/healthcheck
23 cls
24 timeout: 30ms
25 environment:
26 - MYSQL_ALLOW_EMPTY_PASSWORD=yes
27 - MYSQL_USER=root
28 - MYSQL_DATABASE=projectdb
29 ports:
30 - 3306:3306
31 volumes:
32 - mysql-data:/var/lib/mysql/data
33 networks:
34 - pma_networks
35#############################
36# PHPMYADMIN SERVIVICES
37#############################
38 pma:
39 image: phpmyadmin:latest
40 restart: always
41 healthcheck:
42 interval: 120ms
43 retries: 5
44 start_period: 60ms
45 test: |
46 touch /tmp/healthcheck.txt &&
47 mkdir /tmp/healthcheck &&
48 mv /tmp/healthcheck.txt /tmp/healthcheck &&
49 cd /tmp/healthcheck &&
50 echo "hello my docker container is working fine" >> healthcheck.txt &&
51 cat healthcheck.txt &&
52 rm healthcheck.txt &&
53 cd .. &&
54 rmdir /tmp/healthcheck
55 cls
56 timeout: 30ms
57 environment:
58 - PMA_ARBITRARY=1
59 ports:
60 - 80:80
61 depends_on:
62 - db
63 volumes:
64 - pma-data:/var/lib/phpmyadmin/data
65 networks:
66 - pma_networks
67#############################
68# PERSISTENT DATA
69#############################
70volumes:
71 mysql-data:
72 pma-data:
73################################
74# SAME NETWORKS FOR ALL SERVICE
75###############################
76networks:
77 pma_networks: