Skip to content
Snippets Groups Projects
Commit cca5dac4 authored by Hahn Axel (hahn)'s avatar Hahn Axel (hahn)
Browse files

Merge branch 'replace_docker-compose' into 'master'

UNDO "docker compose"; update infos

See merge request !8
parents af307dfc 8ae69c68
No related branches found
No related tags found
1 merge request!8UNDO "docker compose"; update infos
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
# 2023-03-06 v1.5 <www.axel-hahn.de> up with and without --build # 2023-03-06 v1.5 <www.axel-hahn.de> up with and without --build
# 2023-08-17 v1.6 <www.axel-hahn.de> menu selection with single key (without return) # 2023-08-17 v1.6 <www.axel-hahn.de> menu selection with single key (without return)
# 2023-11-10 v1.7 <axel.hahn@unibe.ch> replace docker-compose with "docker compose" # 2023-11-10 v1.7 <axel.hahn@unibe.ch> replace docker-compose with "docker compose"
# 2023-11-13 v1.8 <axel.hahn@unibe.ch> UNDO "docker compose"; update infos
# ====================================================================== # ======================================================================
cd $( dirname $0 ) cd $( dirname $0 )
...@@ -20,7 +21,7 @@ cd $( dirname $0 ) ...@@ -20,7 +21,7 @@ cd $( dirname $0 )
# git@git-repo.iml.unibe.ch:iml-open-source/docker-php-starterkit.git # git@git-repo.iml.unibe.ch:iml-open-source/docker-php-starterkit.git
selfgitrepo="docker-php-starterkit.git" selfgitrepo="docker-php-starterkit.git"
_version="1.7" _version="1.8"
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# FUNCTIONS # FUNCTIONS
...@@ -201,6 +202,14 @@ function _showContainers(){ ...@@ -201,6 +202,14 @@ function _showContainers(){
} }
function _showBrowserurl(){
echo "In a web browser open:"
echo " $frontendurl"
if grep "${APP_NAME}-server" /etc/hosts >/dev/null; then
echo " https://${APP_NAME}-server/"
fi
}
# a bit stupid ... i think I need to delete it. # a bit stupid ... i think I need to delete it.
function _showInfos(){ function _showInfos(){
_showContainers long _showContainers long
...@@ -213,19 +222,20 @@ function _showInfos(){ ...@@ -213,19 +222,20 @@ function _showInfos(){
>/dev/tcp/localhost/${APP_PORT} 2>/dev/null && ( >/dev/tcp/localhost/${APP_PORT} 2>/dev/null && (
echo "OK, app port ${APP_PORT} is reachable" echo "OK, app port ${APP_PORT} is reachable"
echo echo
echo "In a web browser open:" _showBrowserurl
echo " $frontendurl"
) )
h3 "Check database port" if [ "$DB_ADD" != "false" ]; then
>/dev/tcp/localhost/${DB_PORT} 2>/dev/null && ( h3 "Check database port"
echo "OK, db port ${DB_PORT} is reachable" >/dev/tcp/localhost/${DB_PORT} >/dev/null 2>&1 && (
echo echo "OK, db port ${DB_PORT} is reachable"
echo
)
echo "In a local DB admin tool:" echo "In a local DB admin tool:"
echo " host : localhost" echo " host : localhost"
echo " port : ${DB_PORT}" echo " port : ${DB_PORT}"
echo " user : root" echo " user : root"
echo " password: ${MYSQL_ROOT_PASS}" echo " password: ${MYSQL_ROOT_PASS}"
) fi
echo echo
} }
...@@ -260,10 +270,10 @@ while true; do ...@@ -260,10 +270,10 @@ while true; do
echo " $( _key t ) - generate files from templates" echo " $( _key t ) - generate files from templates"
echo " $( _key T ) - remove generated files" echo " $( _key T ) - remove generated files"
echo echo
echo " $( _key u ) - startup containers docker compose ... up -d" echo " $( _key u ) - startup containers docker-compose ... up -d"
echo " $( _key U ) - startup containers docker compose ... up -d --build" echo " $( _key U ) - startup containers docker-compose ... up -d --build"
echo " $( _key s ) - shutdown containers docker compose stop" echo " $( _key s ) - shutdown containers docker-compose stop"
echo " $( _key r ) - remove containers docker compose rm -f" echo " $( _key r ) - remove containers docker-compose rm -f"
echo echo
echo " $( _key m ) - more infos" echo " $( _key m ) - more infos"
echo " $( _key c ) - console (bash)" echo " $( _key c ) - console (bash)"
...@@ -301,26 +311,25 @@ while true; do ...@@ -301,26 +311,25 @@ while true; do
_wait _wait
;; ;;
u|U) u|U)
dockerUp="docker compose -p "$APP_NAME" --verbose up -d --remove-orphans" dockerUp="docker-compose -p "$APP_NAME" --verbose up -d --remove-orphans"
if [ "$action" = "U" ]; then if [ "$action" = "U" ]; then
dockerUp+=" --build" dockerUp+=" --build"
fi fi
if $dockerUp; then if $dockerUp; then
echo "In a web browser:" _showBrowserurl
echo " $frontendurl"
else else
echo "ERROR: docker compose up failed :-/" echo "ERROR: docker-compose up failed :-/"
docker compose -p "$APP_NAME" logs | tail docker-compose -p "$APP_NAME" logs | tail
fi fi
echo echo
_wait _wait
;; ;;
s) s)
docker compose -p "$APP_NAME" stop docker-compose -p "$APP_NAME" stop
;; ;;
r) r)
docker compose -p "$APP_NAME" rm -f docker-compose -p "$APP_NAME" rm -f
;; ;;
c) c)
docker ps docker ps
......
# TARGET: docker/containers/db-server/var_tmp_db-data/readme.txt
# Info
content of `docker/containers/db_server/var_tmp_db-data/` will be visible in the database container as `/var/tmp/db-data/`. It is a helper to transfer/ import sqldumps.
...@@ -62,8 +62,9 @@ services: ...@@ -62,8 +62,9 @@ services:
MYSQL_PASSWORD: '${MYSQL_PASS}' MYSQL_PASSWORD: '${MYSQL_PASS}'
MYSQL_DATABASE: '${MYSQL_DB}' MYSQL_DATABASE: '${MYSQL_DB}'
volumes: volumes:
# - ./containers/db-server/db_data:/var/lib/mysql
- ./containers/db-server/mariadb/my.cnf:/etc/mysql/conf.d/my.cnf - ./containers/db-server/mariadb/my.cnf:/etc/mysql/conf.d/my.cnf
- ./containers/db-server/mariadb/dot_my.cnf:/root/.my.cnf
- ./containers/db-server/var_tmp_db-data/:/var/tmp/db-data
healthcheck: healthcheck:
test: mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_ROOT_PASSWORD test: mysqladmin ping -h 127.0.0.1 -u root --password=$$MYSQL_ROOT_PASSWORD
interval: 5s interval: 5s
......
# TARGET: docker/containers/db-server/mariadb/dot_my.cnf
[client]
user=root
host=localhost
password={{MYSQL_ROOT_PASS}}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment