6.0.2-debian-9-r0 release

This commit is contained in:
Bitnami Bot
2019-09-16 14:12:21 +00:00
parent a27b955720
commit 9afb2662a2
4 changed files with 125 additions and 1 deletions

View File

@@ -0,0 +1,22 @@
FROM bitnami/minideb-extras:stretch-r479
LABEL maintainer "Bitnami <containers@bitnami.com>"
# Install required system packages and dependencies
RUN install_packages ghostscript imagemagick libbz2-1.0 libc6 libcomerr2 libcurl3 libffi6 libfreetype6 libgcc1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libgssapi-krb5-2 libhogweed4 libicu57 libidn11 libidn2-0 libjpeg62-turbo libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 liblzma5 libmemcached11 libmemcachedutil2 libncurses5 libnettle6 libnghttp2-14 libp11-kit0 libpng16-16 libpq5 libpsl5 libreadline7 librtmp1 libsasl2-2 libsqlite3-0 libssh2-1 libssl1.0.2 libssl1.1 libstdc++6 libsybdb5 libtasn1-6 libtidy5 libtinfo5 libunistring0 libxml2 libxslt1.1 libzip4 zlib1g
RUN bitnami-pkg unpack php-7.3.9-1 --checksum c82b1601abbb8cdff5b18d5c162cc04ad64f9582396378195341e43f71eac6a1
RUN bitnami-pkg install node-8.16.1-0 --checksum 912809b0cd1ddc5828dea8f09fdf55e09653e62a95b38dac9823efc8b659fe9a
RUN bitnami-pkg install laravel-6.0.2-0 --checksum 5ab8285bdcefa60c0044b5156661f9dd9fa727840c0a3943e95f84f9860f554c
RUN mkdir /app && chown bitnami:bitnami /app
COPY rootfs /
ENV BITNAMI_APP_NAME="laravel" \
BITNAMI_IMAGE_VERSION="6.0.2-debian-9-r0" \
NODE_PATH="/opt/bitnami/node/lib/node_modules" \
PATH="/opt/bitnami/php/bin:/opt/bitnami/php/sbin:/opt/bitnami/node/bin:/opt/bitnami/laravel/bin:$PATH"
EXPOSE 3000
WORKDIR /app
USER bitnami
ENTRYPOINT [ "/app-entrypoint.sh" ]
CMD [ "php", "artisan", "serve", "--host=0.0.0.0", "--port=3000" ]

View File

@@ -0,0 +1,26 @@
version: '2'
services:
mariadb:
image: 'bitnami/mariadb:10.1'
environment:
- ALLOW_EMPTY_PASSWORD=yes
- MARIADB_USER=my_user
- MARIADB_DATABASE=my_database
- MARIADB_PASSWORD=my_password
myapp:
tty: true
image: bitnami/laravel:6-debian-9
environment:
- DB_HOST=mariadb
- DB_USERNAME=my_user
- DB_DATABASE=my_database
- DB_PASSWORD=my_password
depends_on:
- mariadb
ports:
- 3000:3000
volumes:
- ./:/app
# privileged: true # Privileged mode could be required to run this container under Windows

View File

@@ -0,0 +1,76 @@
#!/bin/bash -e
. /opt/bitnami/base/functions
print_welcome_page
INIT_SEM=/tmp/initialized.sem
fresh_container() {
[ ! -f $INIT_SEM ]
}
app_present() {
[ -f /app/config/database.php ]
}
vendor_present() {
[ -f /app/vendor ]
}
wait_for_db() {
local db_host="${DB_HOST:-mariadb}"
local db_port="${DB_PORT:-3306}"
local db_address=$(getent hosts "$db_host" | awk '{ print $1 }')
counter=0
log "Connecting to mariadb at $db_address"
while ! curl --silent "$db_address:$db_port" >/dev/null; do
counter=$((counter+1))
if [ $counter == 30 ]; then
log "Error: Couldn't connect to mariadb."
exit 1
fi
log "Trying to connect to mariadb at $db_address. Attempt $counter."
sleep 5
done
}
setup_db() {
log "Configuring the database"
sed -i "s/utf8mb4/utf8/g" /app/config/database.php
php artisan migrate --force
}
if [ "${1}" == "php" -a "$2" == "artisan" -a "$3" == "serve" ]; then
if ! app_present; then
log "Creating laravel application"
cp -a /tmp/app/. /app/
fi
log "Installing/Updating Laravel dependencies (composer)"
if ! vendor_present; then
composer install
log "Dependencies installed"
else
composer update
log "Dependencies updated"
fi
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
fi
fi
exec tini -- "$@"

View File

@@ -11,7 +11,7 @@ services:
myapp:
tty: true
image: bitnami/laravel:5-debian-9
image: bitnami/laravel:6-debian-9
environment:
- DB_HOST=mariadb
- DB_USERNAME=my_user