Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docker-php-starterkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
docker-php-starterkit
Commits
8ea20c38
Commit
8ea20c38
authored
7 months ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
docker init v1.22 added: Open Mysql client in container
parent
353f60b6
No related branches found
No related tags found
1 merge request
!23
docker init script: added start of mysql in the database container
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docker/init.sh
+14
-3
14 additions, 3 deletions
docker/init.sh
with
14 additions
and
3 deletions
docker/init.sh
+
14
−
3
View file @
8ea20c38
...
...
@@ -26,6 +26,7 @@
# 2024-09-20 v1.19 <www.axel-hahn.de> detect dockerd-rootless (hides menu item to set permissions)
# 2024-10-16 v1.20 <axel.hahn@unibe.ch> add db import and export
# 2024-10-25 v1.21 <axel.hahn@unibe.ch> create missing subdir dbdumps
# 2024-10-30 v1.22 <axel.hahn@unibe.ch> added: Open Mysql client in container
# ======================================================================
cd
"
$(
dirname
"
$0
"
)
"
||
exit
1
...
...
@@ -39,7 +40,7 @@ _self=$( basename "$0" )
# shellcheck source=/dev/null
.
"
${
_self
}
.cfg"
||
exit
1
_version
=
"1.2
1
"
_version
=
"1.2
2
"
# git@git-repo.iml.unibe.ch:iml-open-source/docker-php-starterkit.git
selfgitrepo
=
"docker-php-starterkit.git"
...
...
@@ -107,11 +108,15 @@ function _getStatus_docker(){
if
[
"
$DB_ADD
"
!=
"false"
]
&&
[
!
-d
"
${
DC_DUMP_DIR
}
"
]
;
then
echo
"INFO: creating subdir
${
DC_DUMP_DIR
}
to import/ export databases ..."
mkdir
"
${
DC_DUMP_DIR
}
"
||
exit
1
return
fi
return
fi
}
# Get web url of the application
# It is for support of Nginx Docker Proxy
# https://github.com/axelhahn/nginx-docker-proxy
# It returns http://localhost:<port> or a https://<appname>
function
_getWebUrl
(){
DC_WEB_URL
=
"
$frontendurl
"
grep
-q
"
${
APP_NAME
}
-server"
/etc/hosts
&&
DC_WEB_URL
=
"https://
${
APP_NAME
}
-server/"
...
...
@@ -182,8 +187,10 @@ function showMenu(){
echo
"
${
_spacer
}
$(
_key p
)
- console check with php linter"
fi
if
[
$DC_DB_UP
-eq
1
]
||
[
$_bAll
-eq
1
]
;
then
echo
echo
"
${
_spacer
}
$(
_key d
)
- Dump container database"
echo
"
${
_spacer
}
$(
_key D
)
- Import Dump into container database"
echo
"
${
_spacer
}
$(
_key M
)
- Open Mysql client in database container"
fi
echo
echo
"
${
_spacer
}
$(
_key q
)
- quit"
...
...
@@ -706,6 +713,10 @@ while true; do
h2
"DB tools :: import"
_dbImport
;;
M
)
h2
"DB tools :: mysql client"
docker
exec
-it
"
${
APP_NAME
}
-db"
mysql
-uroot
-p
${
MYSQL_ROOT_PASS
}
"
${
MYSQL_DB
}
"
;;
o
)
h2
"Open app ..."
xdg-open
"
$DC_WEB_URL
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment