mirror of
https://github.com/bitnami/containers.git
synced 2026-03-10 15:09:17 +08:00
Merge branch 'master' of github.com:alexandernst/bitnami-docker-laravel
This commit is contained in:
@@ -33,7 +33,7 @@ USER bitnami
|
||||
RUN mkdir /tmp/app && cd /tmp/app && composer create-project "laravel/laravel=5.2.31" /tmp/app --prefer-dist
|
||||
|
||||
ENV BITNAMI_APP_NAME=laravel
|
||||
ENV BITNAMI_IMAGE_VERSION=5.2.31-r2
|
||||
ENV BITNAMI_IMAGE_VERSION=5.2.31-r3
|
||||
|
||||
WORKDIR /app
|
||||
EXPOSE 3000
|
||||
|
||||
@@ -10,7 +10,7 @@ services:
|
||||
|
||||
myapp:
|
||||
tty: true
|
||||
image: bitnami/laravel:5.2.31-r1
|
||||
image: bitnami/laravel:5.2.31-r3
|
||||
environment:
|
||||
- DB_HOST=mariadb
|
||||
- DB_USERNAME=my_user
|
||||
|
||||
@@ -42,32 +42,34 @@ log () {
|
||||
echo -e "\033[0;33m$(date "+%H:%M:%S")\033[0;37m ==> $1."
|
||||
}
|
||||
|
||||
if ! app_present; then
|
||||
log "Creating laravel application"
|
||||
\cp -r /tmp/app/ /
|
||||
fi
|
||||
if [ "${1}" == "php" -a "$2" == "artisan" -a "$3" == "serve" ]; then
|
||||
if ! app_present; then
|
||||
log "Creating laravel application"
|
||||
\cp -r /tmp/app/ /
|
||||
fi
|
||||
|
||||
if ! dependencies_up_to_date; then
|
||||
log "Installing/Updating Laravel dependencies (composer)"
|
||||
composer update
|
||||
log "Dependencies updated"
|
||||
fi
|
||||
if ! dependencies_up_to_date; then
|
||||
log "Installing/Updating Laravel dependencies (composer)"
|
||||
composer update
|
||||
log "Dependencies updated"
|
||||
fi
|
||||
|
||||
wait_for_db
|
||||
wait_for_db
|
||||
|
||||
if ! fresh_container; then
|
||||
echo "#########################################################################"
|
||||
echo " "
|
||||
echo " App initialization skipped: "
|
||||
echo " Delete the file $INIT_SEM and restart the container to reinitialize "
|
||||
echo " You can alternatively run specific commands using docker-compose exec "
|
||||
echo " e.g docker-compose exec myapp php artisan make:console FooCommand "
|
||||
echo " "
|
||||
echo "#########################################################################"
|
||||
else
|
||||
setup_db
|
||||
log "Initialization finished"
|
||||
touch $INIT_SEM
|
||||
if ! fresh_container; then
|
||||
echo "#########################################################################"
|
||||
echo " "
|
||||
echo " App initialization skipped: "
|
||||
echo " Delete the file $INIT_SEM and restart the container to reinitialize "
|
||||
echo " You can alternatively run specific commands using docker-compose exec "
|
||||
echo " e.g docker-compose exec myapp php artisan make:console FooCommand "
|
||||
echo " "
|
||||
echo "#########################################################################"
|
||||
else
|
||||
setup_db
|
||||
log "Initialization finished"
|
||||
touch $INIT_SEM
|
||||
fi
|
||||
fi
|
||||
|
||||
exec /entrypoint.sh "$@"
|
||||
|
||||
Reference in New Issue
Block a user