forked from grimzy/laravel-mysql-spatial
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
33 lines (27 loc) · 1.01 KB
/
Makefile
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
V=8.0
DB_DIR=$(shell pwd)/_db-$(V)
mV=10.3
mDB_DIR=$(shell pwd)/_db-$(mV)
start_db:
@echo Starting MySQL $(V)
docker run --rm -d --name spatial-mysql \
--platform "linux/x86_64" \
-p 3306:3306 \
-v $(DB_DIR):/var/lib/mysql \
-e MYSQL_DATABASE=spatial_test \
-e MYSQL_ROOT_PASSWORD=password \
mysql:$(V) --character-set-server=utf8 --collation-server=utf8_general_ci --default-authentication-plugin=mysql_native_password
start_db_maria:
@echo Starting MariaDB $(mV)
docker run --rm -d --name spatial-mysql \
-p 3306:3306 \
-v $(DB_DIR):/var/lib/mysql \
-e MYSQL_DATABASE=spatial_test \
-e MYSQL_ROOT_PASSWORD=password \
mariadb:$(mV) --character-set-server=utf8 --collation-server=utf8_general_ci --default-authentication-plugin=mysql_native_password
rm_db:
docker stop spatial-mysql || true
rm -Rf $(DB_DIR)
refresh_db: rm_db start_db
get_ip:
@docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' spatial-mysql