File tree Expand file tree Collapse file tree 5 files changed +140
-65
lines changed
api/image-files/usr/local/bin Expand file tree Collapse file tree 5 files changed +140
-65
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
-
4
3
echo " _____ __________.___"
5
4
echo " / _ \\ ______ \ |"
6
5
echo " / /_\ \| ___/ |"
7
6
echo " / | \ | | |"
8
7
echo " \____|__ /____| |___|"
9
8
echo " \/"
10
9
11
-
12
10
set -e
13
11
14
- printf " Checking database connection...\n\n"
15
- mysql_ready () {
16
- mysqladmin ping --host=" $DB_HOST " --user=" $DB_USER " --password=" $DB_PASSWORD " > /dev/null 2>&1
17
- }
18
-
19
- while ! (mysql_ready)
20
- do
21
- sleep 3
22
- echo " Waiting for database connection ..."
23
- done
24
-
25
- echo " Database is ready..."
26
-
27
- echo " Starting migration..."
28
- npm run migrate:up
29
- echo " Finished migration..."
30
-
31
12
exec " $@ "
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ echo " _____ .__ __ .__ "
4
+ echo " / \ |__| ________________ _/ |_|__| ____ ____ "
5
+ echo " / \ / \| |/ ___\_ __ \__ \\ __\ |/ _ \ / \ "
6
+ echo " / Y \ / /_/ > | \// __ \| | | ( <_> ) | \ "
7
+ echo " \____|__ /__\___ /|__| (____ /__| |__|\____/|___| / "
8
+ echo " \/ /_____/ \/ \/ "
9
+
10
+ set -e
11
+
12
+ printf " Checking database connection...\n\n"
13
+ mysql_ready () {
14
+ mysqladmin ping --host=" $DB_HOST " --user=" $DB_USER " --password=" $DB_PASSWORD " > /dev/null 2>&1
15
+ }
16
+
17
+ while ! (mysql_ready)
18
+ do
19
+ sleep 3
20
+ echo " Waiting for database connection ..."
21
+ done
22
+
23
+ echo " Database is ready..."
24
+
25
+ echo " Starting migration..."
26
+ npm run migrate:up
27
+ echo " Finished migration..."
28
+
Original file line number Diff line number Diff line change @@ -16,11 +16,47 @@ services:
16
16
ports :
17
17
- 80:80
18
18
19
+ mysql :
20
+ container_name : mysql
21
+ image : mysql:8.0
22
+ networks :
23
+ - internal
24
+ ports :
25
+ - 3307:3306
26
+ volumes :
27
+ - ./mysql/conf.d:/etc/mysql/conf.d
28
+ - mysql_data:/var/lib/mysql
29
+ command : --default-authentication-plugin=mysql_native_password
30
+ environment :
31
+ - MYSQL_ROOT_PASSWORD=root
32
+ - MYSQL_DATABASE=boilerplate
33
+ - TZ=Australia/Melbourne
34
+
35
+ migration :
36
+ container_name : migration
37
+ image : $REGISTRY_DOMAIN/chrisleekr/nodejs-vuejs-mysql-boilerplate:api-dev
38
+ depends_on :
39
+ - mysql
40
+ networks :
41
+ - internal
42
+ environment :
43
+ - DB_HOST=mysql
44
+ - DB_PORT=3306
45
+ - DB_USER=root
46
+ - DB_PASSWORD=root
47
+ - DB_NAME=boilerplate
48
+ - DB_CONNECTION_LIMIT=10
49
+ - DB_DEBUG=true
50
+ - TZ=Australia/Melbourne
51
+ command :
52
+ - /usr/local/bin/migration.sh
53
+
19
54
api :
20
55
container_name : api
21
56
image : $REGISTRY_DOMAIN/chrisleekr/nodejs-vuejs-mysql-boilerplate:api-dev
22
57
depends_on :
23
58
- mysql
59
+ - migration
24
60
networks :
25
61
- internal
26
62
environment :
@@ -81,21 +117,6 @@ services:
81
117
- API_URL=http://api:3000
82
118
command : npm run serve
83
119
84
- mysql :
85
- container_name : mysql
86
- image : mysql:8.0
87
- networks :
88
- - internal
89
- ports :
90
- - 3307:3306
91
- volumes :
92
- - ./mysql/conf.d:/etc/mysql/conf.d
93
- - mysql_data:/var/lib/mysql
94
- command : --default-authentication-plugin=mysql_native_password
95
- environment :
96
- - MYSQL_ROOT_PASSWORD=root
97
- - MYSQL_DATABASE=boilerplate
98
- - TZ=Australia/Melbourne
99
120
100
121
mailhog :
101
122
container_name : mailhog
Original file line number Diff line number Diff line change @@ -16,11 +16,47 @@ services:
16
16
ports :
17
17
- 80:80
18
18
19
+ mysql :
20
+ container_name : mysql
21
+ image : mysql:8.0
22
+ networks :
23
+ - internal
24
+ ports :
25
+ - 3307:3306
26
+ volumes :
27
+ - ./mysql/conf.d:/etc/mysql/conf.d
28
+ - mysql_data:/var/lib/mysql
29
+ command : --default-authentication-plugin=mysql_native_password
30
+ environment :
31
+ - MYSQL_ROOT_PASSWORD=root
32
+ - MYSQL_DATABASE=boilerplate
33
+ - TZ=Australia/Melbourne
34
+
35
+ migration :
36
+ container_name : migration
37
+ image : $REGISTRY_DOMAIN/chrisleekr/nodejs-vuejs-mysql-boilerplate:api-latest
38
+ depends_on :
39
+ - mysql
40
+ networks :
41
+ - internal
42
+ environment :
43
+ - DB_HOST=mysql
44
+ - DB_PORT=3306
45
+ - DB_USER=root
46
+ - DB_PASSWORD=root
47
+ - DB_NAME=boilerplate
48
+ - DB_CONNECTION_LIMIT=10
49
+ - DB_DEBUG=true
50
+ - TZ=Australia/Melbourne
51
+ command :
52
+ - /usr/local/bin/migration.sh
53
+
19
54
api :
20
55
container_name : api
21
56
image : $REGISTRY_DOMAIN/chrisleekr/nodejs-vuejs-mysql-boilerplate:api-latest
22
57
depends_on :
23
58
- mysql
59
+ - migration
24
60
networks :
25
61
- internal
26
62
environment :
@@ -79,22 +115,6 @@ services:
79
115
environment :
80
116
- API_URL=http://$SERVICE_DOMAIN/api
81
117
82
- mysql :
83
- container_name : mysql
84
- image : mysql:8.0
85
- networks :
86
- - internal
87
- ports :
88
- - 3307:3306
89
- volumes :
90
- - ./mysql/conf.d:/etc/mysql/conf.d
91
- - mysql_data:/var/lib/mysql
92
- command : --default-authentication-plugin=mysql_native_password
93
- environment :
94
- - MYSQL_ROOT_PASSWORD=root
95
- - MYSQL_DATABASE=boilerplate
96
- - TZ=Australia/Melbourne
97
-
98
118
mailhog :
99
119
container_name : mailhog
100
120
image : mailhog/mailhog
Original file line number Diff line number Diff line change @@ -16,13 +16,53 @@ services:
16
16
ports :
17
17
- 80:80
18
18
19
+ mysql :
20
+ container_name : mysql
21
+ image : mysql:8.0
22
+ networks :
23
+ - internal
24
+ ports :
25
+ - 3307:3306
26
+ volumes :
27
+ - ./mysql/conf.d:/etc/mysql/conf.d
28
+ - mysql_data:/var/lib/mysql
29
+ command : --default-authentication-plugin=mysql_native_password
30
+ environment :
31
+ - MYSQL_ROOT_PASSWORD=root
32
+ - MYSQL_DATABASE=boilerplate
33
+ - TZ=Australia/Melbourne
34
+
35
+ migration :
36
+ container_name : migration
37
+ build :
38
+ context : ./api
39
+ target : dev-stage
40
+ depends_on :
41
+ - mysql
42
+ networks :
43
+ - internal
44
+ # volumes:
45
+ # - ./api:/srv
46
+ environment :
47
+ - DB_HOST=mysql
48
+ - DB_PORT=3306
49
+ - DB_USER=root
50
+ - DB_PASSWORD=root
51
+ - DB_NAME=boilerplate
52
+ - DB_CONNECTION_LIMIT=10
53
+ - DB_DEBUG=true
54
+ - TZ=Australia/Melbourne
55
+ command :
56
+ - /usr/local/bin/migration.sh
57
+
19
58
api :
20
59
container_name : api
21
60
build :
22
61
context : ./api
23
62
target : dev-stage
24
63
depends_on :
25
64
- mysql
65
+ - migration
26
66
networks :
27
67
- internal
28
68
# volumes:
@@ -100,21 +140,6 @@ services:
100
140
- BASE_URL=/backend/
101
141
- API_URL=http://localhost/api
102
142
103
- mysql :
104
- container_name : mysql
105
- image : mysql:8.0
106
- networks :
107
- - internal
108
- ports :
109
- - 3307:3306
110
- volumes :
111
- - ./mysql/conf.d:/etc/mysql/conf.d
112
- - mysql_data:/var/lib/mysql
113
- command : --default-authentication-plugin=mysql_native_password
114
- environment :
115
- - MYSQL_ROOT_PASSWORD=root
116
- - MYSQL_DATABASE=boilerplate
117
- - TZ=Australia/Melbourne
118
143
119
144
mailhog :
120
145
container_name : mailhog
You can’t perform that action at this time.
0 commit comments