-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
126 lines (115 loc) · 3.38 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
version: "3.7"
services:
mysql-server-service:
image: 127.0.0.1:5000/mysql-restsql-mysql-server-image
build:
context: .
dockerfile: ./docker/mysql-server/Dockerfile
environment:
MYSQL_ROOT_PASSWORD: rootpwd
MYSQL_ROOT_HOST: "%"
MYSQL_DATABASE: mysql_rest_sql_docker
ports:
- "33666:3306"
volumes:
- mysql-server-volume:/var/lib/mysql
networks:
- mysql_rest_sql-network
command: ["mysqld","--bind-address=0.0.0.0", "--sql-mode=STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO", "--skip-name-resolve","--default_authentication_plugin=mysql_native_password",]
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
mysql-client-service:
image: mysql:8.0
volumes:
- ./docker/mysql-client/sql_files:/opt/sql_files
- ./docker/mysql-client/entrypoint.sh:/opt/entrypoint
- ./docker/mysql-client/.env:/opt/.env
networks:
- mysql_rest_sql-network
depends_on:
mysql-server-service:
condition: service_healthy
entrypoint: ["/bin/sh", "/opt/entrypoint"]
restsql-service:
image: 127.0.0.1:5000/mysql-restsql-restsql-image
container_name: restsql-container
build:
context: .
dockerfile: ./docker/restsql/Dockerfile
args:
SQL_RESOURCES_DIR: "/etc/opt/restsql/sqlresources"
SHARED_USER: riccardo
SHARED_GROUP: riccardo
SHARED_UID: 1000
SHARED_GID: 1000
SHARED_USER_PWD: riccardopwd
ports:
- 8881:8080
volumes:
- rest_sql-volume:/etc/opt/restsql
- ./docker/restsql/logs:/var/log/restsql
- ./docker/restsql/security:/etc/opt/restsql-security
- ./docker/restsql/tomcat/conf/tomcat-users.xml:/usr/local/tomcat/conf/tomcat-users.xml
- ./docker/restsql/tomcat/webapps/restsql/WEB-INF/web.xml:/etc/opt/restSqlWeb.xml
- ./docker/restsql/set-webapp-security.sh:/etc/opt/setsec
networks:
- mysql_rest_sql-network
depends_on:
- mysql-client-service
healthcheck:
test: ["CMD-SHELL", "curl -f http://127.0.0.1:8080"]
interval: 30s
timeout: 10s
retries: 3
restsql-service-configurator:
image: docker:dind
privileged: true
volumes:
- /var/run/docker.sock:/var/run/docker.sock
working_dir: /etc/opt
networks:
- mysql_rest_sql-network
depends_on:
restsql-service:
condition: service_healthy
command:
- /bin/sh
- -c
- |
docker exec restsql-container sh /etc/opt/setsec
docker restart restsql-container
phpmyadmin-service:
image: 127.0.0.1:5000/mysql-restsq-phpmyadmin-service-image
container_name: mysql-restsq-phpmyadmin-container
build:
context: .
dockerfile: ./docker/phpmyadmin/Dockerfile
networks:
- mysql_rest_sql-network
depends_on:
- mysql-client-service
ports:
- 8877:80
environment:
MYSQL_USERNAME: root
MYSQL_ROOT_PASSWORD: rootpwd
PMA_HOST: mysql-server-service
PMA_ARBITRARY: 1
networks:
mysql_rest_sql-network:
driver: bridge
volumes:
mysql-server-volume:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "./docker/mysql-server/.data"
rest_sql-volume:
driver: local
driver_opts:
type: "none"
o: "bind"
device: "./docker/restsql/restsql-conf"