File tree Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Expand file tree Collapse file tree 3 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -48,7 +48,7 @@ services:
4848 image : " ${PROJECT_NAME}/mysql:1.0"
4949 build : ./mysql
5050 volumes :
51- - ./data/mysql :/var/lib/mysql
51+ - ./mysql/ data/project_db :/var/lib/mysql
5252 - ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
5353 ports :
5454 - " 3306:3306"
@@ -64,7 +64,7 @@ services:
6464 image : " ${PROJECT_NAME}/test_db:1.0"
6565 build : ./mysql
6666 volumes :
67- - ./data/test_db:/var/lib/mysql
67+ - ./mysql/ data/test_db:/var/lib/mysql
6868 - ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
6969 ports :
7070 - " 3307:3306"
Original file line number Diff line number Diff line change 11init_app (){
22 install_packages
3-
3+ run_migrations
44 if ! env_file_exists >> /dev /null 2 > & 1 ; then
55 cp_env
66 generate_key
77 fi
88}
99
10+ run_migrations (){
11+ docker - compose - f $DOCKER_COMPOSE_FILE_PATH exec app php artisan migrate
12+ }
13+
1014install_packages (){
1115 docker - compose - f $DOCKER_COMPOSE_FILE_PATH exec app composer install
1216}
Original file line number Diff line number Diff line change @@ -30,10 +30,19 @@ if ! [ -f "$NGINX_REAL_SITE_PATH" ]; then
3030fi
3131printf " nginx site file looks ok.\n\n"
3232
33-
34- if [ " $FIRST_ARG " = " build " ]; then
33+ printf " Validating main db file...\n\n "
34+ if ! [ -f " $MAIN_DB_FILE_PATH " ]; then
3535 create_sql_file_if_not_exist " $MYSQL_ENTRY_POINT_CREATE_MAIN_DB_CONTENT " " $MAIN_DB_FILE_PATH "
36+ printf " main db file validated.\n\n"
37+ fi
38+ printf " Validating test db file...\n\n"
39+ if ! [ -f " $TEST_DB_FILE_PATH " ]; then
3640 create_sql_file_if_not_exist " $MYSQL_ENTRY_POINT_CREATE_TEST_DB_CONTENT " " $TEST_DB_FILE_PATH "
41+ printf " test db file validated.\n\n"
42+ fi
43+ printf " db files looks ok.\n\n"
44+
45+ if [ " $FIRST_ARG " = " build" ]; then
3746 docker_down
3847 docker_build
3948 docker_up
You can’t perform that action at this time.
0 commit comments