mirror of
https://github.com/bitnami/containers.git
synced 2026-03-11 16:07:50 +08:00
7.0.0-debian-10-r0 release
This commit is contained in:
30
bitnami/laravel/7/debian-10/Dockerfile
Normal file
30
bitnami/laravel/7/debian-10/Dockerfile
Normal file
@@ -0,0 +1,30 @@
|
||||
FROM bitnami/minideb:buster
|
||||
LABEL maintainer "Bitnami <containers@bitnami.com>"
|
||||
|
||||
ENV PATH="/opt/bitnami/php/bin:/opt/bitnami/php/sbin:/opt/bitnami/node/bin:/opt/bitnami/common/bin:/opt/bitnami/laravel/bin:/opt/bitnami/common/bin:/opt/bitnami/nami/bin:$PATH"
|
||||
|
||||
COPY prebuildfs /
|
||||
# Install required system packages and dependencies
|
||||
RUN install_packages ca-certificates curl dirmngr ghostscript gnupg imagemagick libbsd0 libbz2-1.0 libc6 libcom-err2 libcurl4 libexpat1 libffi6 libfftw3-double3 libfontconfig1 libfreetype6 libgcc1 libgcrypt20 libglib2.0-0 libgmp10 libgnutls30 libgomp1 libgpg-error0 libgssapi-krb5-2 libhogweed4 libicu63 libidn2-0 libjpeg62-turbo libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 liblcms2-2 libldap-2.4-2 liblqr-1-0 libltdl7 liblzma5 libmagickcore-6.q16-6 libmagickwand-6.q16-6 libmcrypt4 libmemcached11 libmemcachedutil2 libncurses6 libncursesw6 libnettle6 libnghttp2-14 libp11-kit0 libpcre3 libpng16-16 libpq5 libpsl5 libreadline7 librtmp1 libsasl2-2 libsqlite3-0 libssh2-1 libssl1.1 libstdc++6 libsybdb5 libtasn1-6 libtidy5deb1 libtinfo6 libunistring2 libuuid1 libx11-6 libxau6 libxcb1 libxdmcp6 libxext6 libxml2 libxslt1.1 libzip4 procps sudo unzip zlib1g
|
||||
RUN /build/bitnami-user.sh
|
||||
RUN /build/install-nami.sh
|
||||
RUN bitnami-pkg unpack php-7.3.15-1 --checksum 720a3692688580331d524cc84c0595f0e50e96d342ad0c8880fabb6854b014b6
|
||||
RUN bitnami-pkg install node-12.16.1-0 --checksum 36bab987be1cc792c7155e30545b004b76fc9a81796afec343a0a698935204b2
|
||||
RUN bitnami-pkg install tini-0.18.0-3 --checksum 1e9b72b6636c6a48397a18df2363b44461e87ad7f892c179a9115c7525ed9327
|
||||
RUN bitnami-pkg install laravel-7.0.0-0 --checksum 6708ee3ae9068dff5da6fdc532043b9ebb9c774a56eff2645f17d1ad07388e62
|
||||
RUN bitnami-pkg install gosu-1.11.0-3 --checksum c18bb8bcc95aa2494793ed5a506c4d03acc82c8c60ad061d5702e0b4048f0cb1
|
||||
RUN apt-get update && apt-get upgrade -y && \
|
||||
rm -r /var/lib/apt/lists /var/cache/apt/archives
|
||||
RUN mkdir /app && chown bitnami:bitnami /app
|
||||
|
||||
COPY rootfs /
|
||||
ENV BITNAMI_APP_NAME="laravel" \
|
||||
BITNAMI_IMAGE_VERSION="7.0.0-debian-10-r0" \
|
||||
NODE_PATH="/opt/bitnami/node/lib/node_modules"
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
WORKDIR /app
|
||||
USER bitnami
|
||||
ENTRYPOINT [ "/app-entrypoint.sh" ]
|
||||
CMD [ "php", "artisan", "serve", "--host=0.0.0.0", "--port=3000" ]
|
||||
26
bitnami/laravel/7/debian-10/docker-compose.yml
Normal file
26
bitnami/laravel/7/debian-10/docker-compose.yml
Normal 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:7
|
||||
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
|
||||
6
bitnami/laravel/7/debian-10/prebuildfs/build/bitnami-user.sh
Executable file
6
bitnami/laravel/7/debian-10/prebuildfs/build/bitnami-user.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
useradd -ms /bin/bash bitnami
|
||||
mkdir -p /opt/bitnami
|
||||
sed -i -e 's/\s*Defaults\s*secure_path\s*=/# Defaults secure_path=/' /etc/sudoers
|
||||
echo 'bitnami ALL=NOPASSWD: ALL' >> /etc/sudoers
|
||||
7
bitnami/laravel/7/debian-10/prebuildfs/build/install-nami.sh
Executable file
7
bitnami/laravel/7/debian-10/prebuildfs/build/install-nami.sh
Executable file
@@ -0,0 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
curl --silent -L https://nami-prod.s3.amazonaws.com/tools/nami/releases/nami-1.0.0-1-linux-x64.tar.gz > /tmp/nami-linux-x64.tar.gz
|
||||
echo "80488279b056d5e9c183fe34097c5f496715ab16a602afcc9f78d59f15139a16 /tmp/nami-linux-x64.tar.gz" | sha256sum --check
|
||||
mkdir -p /opt/bitnami/nami /opt/bitnami/licenses
|
||||
tar xzf /tmp/nami-linux-x64.tar.gz --strip 1 -C /opt/bitnami/nami && rm /tmp/nami-linux-x64.tar.gz
|
||||
curl --silent -L https://raw.githubusercontent.com/bitnami/nami/master/COPYING > /opt/bitnami/licenses/nami-1.0.0-1.txt
|
||||
@@ -0,0 +1,121 @@
|
||||
#!/bin/bash
|
||||
|
||||
[[ ${BASH_DEBUG:-false} = true ]] && set -x
|
||||
|
||||
# Constants
|
||||
MODULE="$(basename "$0")"
|
||||
BITNAMI_PREFIX=/opt/bitnami
|
||||
|
||||
# Color Palette
|
||||
RESET='\033[0m'
|
||||
BOLD='\033[1m'
|
||||
|
||||
## Foreground
|
||||
BLACK='\033[38;5;0m'
|
||||
RED='\033[38;5;1m'
|
||||
GREEN='\033[38;5;2m'
|
||||
YELLOW='\033[38;5;3m'
|
||||
BLUE='\033[38;5;4m'
|
||||
MAGENTA='\033[38;5;5m'
|
||||
CYAN='\033[38;5;6m'
|
||||
WHITE='\033[38;5;7m'
|
||||
|
||||
## Background
|
||||
ON_BLACK='\033[48;5;0m'
|
||||
ON_RED='\033[48;5;1m'
|
||||
ON_GREEN='\033[48;5;2m'
|
||||
ON_YELLOW='\033[48;5;3m'
|
||||
ON_BLUE='\033[48;5;4m'
|
||||
ON_MAGENTA='\033[48;5;5m'
|
||||
ON_CYAN='\033[48;5;6m'
|
||||
ON_WHITE='\033[48;5;7m'
|
||||
|
||||
# Functions
|
||||
|
||||
########################
|
||||
# Print to STDERR
|
||||
# Arguments:
|
||||
# Message to print
|
||||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
stderr_print() {
|
||||
printf "%b\\n" "${*}" >&2
|
||||
}
|
||||
|
||||
########################
|
||||
# Log message
|
||||
# Arguments:
|
||||
# Message to log
|
||||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
log() {
|
||||
stderr_print "${NAMI_DEBUG:+${CYAN}${MODULE:-} ${MAGENTA}$(date "+%T.%2N ")}${RESET}${*}"
|
||||
}
|
||||
########################
|
||||
# Log an 'info' message
|
||||
# Arguments:
|
||||
# Message to log
|
||||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
info() {
|
||||
log "${GREEN}INFO ${RESET} ==> ${*}"
|
||||
}
|
||||
########################
|
||||
# Log message
|
||||
# Arguments:
|
||||
# Message to log
|
||||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
warn() {
|
||||
log "${YELLOW}WARN ${RESET} ==> ${*}"
|
||||
}
|
||||
########################
|
||||
# Log an 'error' message
|
||||
# Arguments:
|
||||
# Message to log
|
||||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
error() {
|
||||
log "${RED}ERROR${RESET} ==> ${*}"
|
||||
}
|
||||
########################
|
||||
# Print the welcome page
|
||||
# Globals:
|
||||
# DISABLE_WELCOME_MESSAGE
|
||||
# BITNAMI_APP_NAME
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
print_welcome_page() {
|
||||
if [[ -z "${DISABLE_WELCOME_MESSAGE:-}" ]]; then
|
||||
if [[ -n "$BITNAMI_APP_NAME" ]]; then
|
||||
print_image_welcome_page
|
||||
fi
|
||||
fi
|
||||
}
|
||||
########################
|
||||
# Print the welcome page for a Bitnami Docker image
|
||||
# Globals:
|
||||
# BITNAMI_APP_NAME
|
||||
# Arguments:
|
||||
# None
|
||||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
print_image_welcome_page() {
|
||||
local github_url="https://github.com/bitnami/bitnami-docker-${BITNAMI_APP_NAME}"
|
||||
|
||||
log ""
|
||||
log "${BOLD}Welcome to the Bitnami ${BITNAMI_APP_NAME} container${RESET}"
|
||||
log "Subscribe to project updates by watching ${BOLD}${github_url}${RESET}"
|
||||
log "Submit issues and feature requests at ${BOLD}${github_url}/issues${RESET}"
|
||||
log "Send us your feedback at ${BOLD}containers@bitnami.com${RESET}"
|
||||
log ""
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
|
||||
. /opt/bitnami/base/functions
|
||||
|
||||
########################
|
||||
# Helper function to initialize a single nami module
|
||||
# Arguments:
|
||||
# Module to initialize
|
||||
# Returns:
|
||||
# None
|
||||
# Description:
|
||||
# Initialize an unpacked nami module with the `nami initialize` command.
|
||||
# Command arguments can be specified as function argumnts after the module name.
|
||||
# `--log-level trace` flag is added to the command if `NAMI_DEBUG` env variable exists.
|
||||
# The log level can be overriden using the `NAMI_LOG_LEVEL` env variable.
|
||||
#########################
|
||||
nami_initialize_one() {
|
||||
local module="${1:?module not specified}"
|
||||
if nami inspect $module | grep -q '"lifecycle": "unpacked"'; then
|
||||
local inputs=
|
||||
if [[ -f "/${module}-inputs.json" ]]; then
|
||||
inputs="--inputs-file=/${module}-inputs.json"
|
||||
fi
|
||||
nami ${NAMI_DEBUG:+--log-level ${NAMI_LOG_LEVEL:-trace}} initialize $module $inputs "${@:2}"
|
||||
fi
|
||||
}
|
||||
|
||||
########################
|
||||
# Helper function to initialize one or more nami modules
|
||||
# Arguments:
|
||||
# Module to initialize
|
||||
# Returns:
|
||||
# None
|
||||
#########################
|
||||
nami_initialize() {
|
||||
local module="${1:?module not specified}"
|
||||
for module in "${@}"; do
|
||||
nami_initialize_one $module
|
||||
done
|
||||
}
|
||||
211
bitnami/laravel/7/debian-10/prebuildfs/usr/sbin/bitnami-pkg
Executable file
211
bitnami/laravel/7/debian-10/prebuildfs/usr/sbin/bitnami-pkg
Executable file
@@ -0,0 +1,211 @@
|
||||
#!/bin/bash -e
|
||||
. /opt/bitnami/base/functions
|
||||
|
||||
print_usage() {
|
||||
log "Usage: bitnami-pkg <COMMAND> <PACKAGE>-<VERSION> [OPTIONS] -- [ARGS]"
|
||||
log ""
|
||||
log "Download and install Bitnami packages"
|
||||
log ""
|
||||
log "Commands:"
|
||||
log " install Download and install a package."
|
||||
log " unpack Download and unpack a package."
|
||||
log ""
|
||||
log "Options:"
|
||||
log " -b, --bucket Package release bucket (default: stacksmith)."
|
||||
log " -c, --checksum SHA256 verification checksum."
|
||||
log " -h, --help Show this help message and exit."
|
||||
log ""
|
||||
log "If the package is already available in the /tmp/bitnami/pkg/cache/"
|
||||
log "directory, the download will be skipped. If there is a corresponding"
|
||||
log "file of the same name post-fixed with .sha256 in the directory,"
|
||||
log "that sha will be used instead of the --checksum option."
|
||||
log ""
|
||||
log "Examples:"
|
||||
log " - Unpack package"
|
||||
log " \$ bitnami-pkg unpack nginx-1.9.10-0"
|
||||
log ""
|
||||
log " - Verify and Install package"
|
||||
log " \$ bitnami-pkg install nginx-1.9.10-0 --checksum 15565d06b18c2e3710fc08e579ddb3d0e39aa663264a0f7404f0743cb4cdb58d"
|
||||
log ""
|
||||
log " - Install package with arguments"
|
||||
log " \$ bitnami-pkg install mariadb-10.1.11-0 -- --password bitnami"
|
||||
log ""
|
||||
log " - Install package from testing"
|
||||
log " \$ bitnami-pkg install mariadb-10.1.11-0 --bucket testing"
|
||||
log ""
|
||||
}
|
||||
|
||||
identify_distro() {
|
||||
distro="${IMAGE_OS:-unknown}"
|
||||
if [ "${distro}" == "unknown" -a -f /etc/os-release ]; then
|
||||
distro="$(grep "^ID=" /etc/os-release | cut -d'=' -f2 | cut -d'"' -f2)-$(grep "^VERSION_ID=" /etc/os-release | cut -d'=' -f2 | cut -d'"' -f2 | cut -d'.' -f1)"
|
||||
fi
|
||||
echo "$distro"
|
||||
}
|
||||
|
||||
identify_arch() {
|
||||
local arch=$(uname -m)
|
||||
|
||||
case "${arch}" in
|
||||
ppc64le)
|
||||
;; # no-op
|
||||
x86_64)
|
||||
case $(identify_distro) in
|
||||
debian-*)
|
||||
arch=amd64
|
||||
;;
|
||||
ol-*)
|
||||
arch=x86_64
|
||||
;;
|
||||
centos-*)
|
||||
arch=x86_64
|
||||
;;
|
||||
rhel-*)
|
||||
arch=x86_64
|
||||
;;
|
||||
photon-*)
|
||||
arch=x86_64
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
*)
|
||||
arch="unknown"
|
||||
;;
|
||||
esac
|
||||
echo $arch
|
||||
}
|
||||
|
||||
# break up command line for easy parsing and check legal options
|
||||
ARGS=$(getopt -o b:c:h -l "bucket:,checksum:,help" -n "bitnami-pkg" -- "$@")
|
||||
if [ $? -ne 0 ];
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
eval set -- "$ARGS";
|
||||
while true; do
|
||||
case "$1" in
|
||||
-b|--bucket)
|
||||
shift
|
||||
if [ -n "$1" ]; then
|
||||
RELEASE_BUCKET=$1
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
-c|--checksum)
|
||||
shift
|
||||
if [ -n "$1" ]; then
|
||||
PACKAGE_SHA256=$1
|
||||
shift
|
||||
fi
|
||||
;;
|
||||
-h|--help)
|
||||
print_usage
|
||||
exit 0
|
||||
;;
|
||||
--)
|
||||
shift
|
||||
break
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# weed out unrecognized commands
|
||||
case "$1" in
|
||||
install|unpack) ;;
|
||||
*)
|
||||
error "Unrecognized command: $1"
|
||||
print_usage
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
# install/unpack command need to be supplied a package name
|
||||
if [ $# -lt 2 ]; then
|
||||
print_usage
|
||||
exit 1
|
||||
fi
|
||||
|
||||
INSTALL_ROOT=/tmp/bitnami/pkg/install
|
||||
CACHE_ROOT=/tmp/bitnami/pkg/cache
|
||||
|
||||
PACKAGE="$2-linux-$(identify_arch)-$(identify_distro)"
|
||||
PACKAGE_ARGS=${@:3}
|
||||
PACKAGE_NAME=$(echo $PACKAGE | sed 's/-[0-9].*//')
|
||||
RELEASE_BUCKET=${RELEASE_BUCKET:-stacksmith}
|
||||
|
||||
mkdir -p $INSTALL_ROOT
|
||||
cd $INSTALL_ROOT
|
||||
|
||||
info "Downloading $PACKAGE package"
|
||||
if [ -f $CACHE_ROOT/$PACKAGE.tar.gz ]; then
|
||||
info "$CACHE_ROOT/$PACKAGE.tar.gz already exists, skipping download."
|
||||
cp $CACHE_ROOT/$PACKAGE.tar.gz .
|
||||
if [ -f $CACHE_ROOT/$PACKAGE.tar.gz.sha256 ]; then
|
||||
info "Using the local sha256 from $CACHE_ROOT/$PACKAGE.tar.gz.sha256"
|
||||
PACKAGE_SHA256=$(cat $CACHE_ROOT/$PACKAGE.tar.gz.sha256)
|
||||
fi
|
||||
else
|
||||
# display cURL progress bar when a tty is attached
|
||||
if tty -s; then
|
||||
CURL_ARGS="-#"
|
||||
else
|
||||
CURL_ARGS="-sS"
|
||||
fi
|
||||
if ! curl $CURL_ARGS -LOf "https://downloads.bitnami.com/files/$RELEASE_BUCKET/$PACKAGE.tar.gz"; then
|
||||
warn "Package name '$PACKAGE' does not exist, will try '${PACKAGE%-$(identify_distro)}'..."
|
||||
if curl $CURL_ARGS -LOf "https://downloads.bitnami.com/files/$RELEASE_BUCKET/${PACKAGE%-$(identify_distro)}.tar.gz"; then
|
||||
PACKAGE="${PACKAGE%-$(identify_distro)}"
|
||||
else
|
||||
error "Could not find the requested package..."
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if ! tar tzf $PACKAGE.tar.gz >/dev/null 2>&1; then
|
||||
error "Invalid or corrupt '$PACKAGE' package."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ "$PACKAGE_SHA256" ]; then
|
||||
info "Verifying package integrity"
|
||||
echo "$PACKAGE_SHA256 $PACKAGE.tar.gz" | sha256sum -c -
|
||||
fi
|
||||
|
||||
# If the tarball has too many files, it can trigger a bug
|
||||
# in overlayfs when using tar. Install bsdtar in the container image
|
||||
# to workaround it. As the overhead is too big (~40 MB), it is not added by
|
||||
# default. Source: https://github.com/coreos/bugs/issues/1095
|
||||
if which bsdtar > /dev/null; then
|
||||
bsdtar -xf $PACKAGE.tar.gz
|
||||
else
|
||||
tar xzf $PACKAGE.tar.gz
|
||||
fi
|
||||
|
||||
case "$1" in
|
||||
install) info "Installing $PACKAGE" ;;
|
||||
unpack) info "Unpacking $PACKAGE" ;;
|
||||
esac
|
||||
nami $1 $PACKAGE $PACKAGE_ARGS
|
||||
|
||||
rm -rf $INSTALL_ROOT
|
||||
|
||||
if [ "$BITNAMI_PKG_EXTRA_DIRS" ]; then
|
||||
info "Creating extra directories"
|
||||
for i in ${BITNAMI_PKG_EXTRA_DIRS}; do
|
||||
mkdir -p $i
|
||||
done
|
||||
fi
|
||||
|
||||
if [ "$BITNAMI_PKG_CHMOD" ]; then
|
||||
DIRS="/.nami /bitnami $BITNAMI_PKG_EXTRA_DIRS"
|
||||
if ! [[ $PACKAGE_NAME =~ .*-client ]]; then
|
||||
mkdir -p /bitnami/$PACKAGE_NAME
|
||||
fi
|
||||
# We need to be in $HOME in order to nami inspect works
|
||||
cd $HOME
|
||||
DIRS+=" $(nami inspect $PACKAGE_NAME | grep -e '"installdir"' | cut -f4 -d\")"
|
||||
info "Fixing permissions: chmod $BITNAMI_PKG_CHMOD $DIRS"
|
||||
chmod $BITNAMI_PKG_CHMOD $DIRS
|
||||
fi
|
||||
110
bitnami/laravel/7/debian-10/rootfs/app-entrypoint.sh
Executable file
110
bitnami/laravel/7/debian-10/rootfs/app-entrypoint.sh
Executable file
@@ -0,0 +1,110 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -o errexit
|
||||
set -o pipefail
|
||||
# set -o xtrace
|
||||
|
||||
# Load libraries
|
||||
# shellcheck disable=SC1091
|
||||
. /opt/bitnami/base/functions
|
||||
|
||||
# Constants
|
||||
INIT_SEM=/tmp/initialized.sem
|
||||
|
||||
# Functions
|
||||
|
||||
########################
|
||||
# Replace a regex in a file
|
||||
# Arguments:
|
||||
# $1 - filename
|
||||
# $2 - match regex
|
||||
# $3 - substitute regex
|
||||
# $4 - regex modifier
|
||||
# Returns: none
|
||||
#########################
|
||||
replace_in_file() {
|
||||
local filename="${1:?filename is required}"
|
||||
local match_regex="${2:?match regex is required}"
|
||||
local substitute_regex="${3:?substitute regex is required}"
|
||||
local regex_modifier="${4:-}"
|
||||
local result
|
||||
|
||||
# We should avoid using 'sed in-place' substitutions
|
||||
# 1) They are not compatible with files mounted from ConfigMap(s)
|
||||
# 2) We found incompatibility issues with Debian10 and "in-place" substitutions
|
||||
result="$(sed "${regex_modifier}s@${match_regex}@${substitute_regex}@g" "$filename")"
|
||||
echo "$result" > "$filename"
|
||||
}
|
||||
|
||||
########################
|
||||
# Wait for database to be ready
|
||||
# Globals:
|
||||
# DATABASE_HOST
|
||||
# DB_PORT
|
||||
# Arguments: none
|
||||
# Returns: none
|
||||
#########################
|
||||
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 the database configuration
|
||||
# Arguments: none
|
||||
# Returns: none
|
||||
#########################
|
||||
setup_db() {
|
||||
log "Configuring the database"
|
||||
replace_in_file "/app/config/database.php" "utf8mb4" "utf8"
|
||||
php artisan migrate --force
|
||||
}
|
||||
|
||||
print_welcome_page
|
||||
|
||||
if [ "${1}" == "php" -a "$2" == "artisan" -a "$3" == "serve" ]; then
|
||||
if [[ ! -f /app/config/database.php ]]; then
|
||||
log "Creating laravel application"
|
||||
cp -a /tmp/app/. /app/
|
||||
fi
|
||||
|
||||
log "Installing/Updating Laravel dependencies (composer)"
|
||||
if [[ ! -f /app/vendor ]]; then
|
||||
composer install
|
||||
log "Dependencies installed"
|
||||
else
|
||||
composer update
|
||||
log "Dependencies updated"
|
||||
fi
|
||||
|
||||
wait_for_db
|
||||
|
||||
if [[ -f $INIT_SEM ]]; 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 -- "$@"
|
||||
3
bitnami/laravel/7/debian-10/rootfs/licenses/licenses.txt
Normal file
3
bitnami/laravel/7/debian-10/rootfs/licenses/licenses.txt
Normal file
@@ -0,0 +1,3 @@
|
||||
Bitnami containers ship with software bundles. You can find the licenses under:
|
||||
/opt/bitnami/nami/COPYING
|
||||
/opt/bitnami/[name-of-bundle]/licenses/[bundle-version].txt
|
||||
@@ -11,7 +11,7 @@ services:
|
||||
|
||||
myapp:
|
||||
tty: true
|
||||
image: bitnami/laravel:6
|
||||
image: bitnami/laravel:7
|
||||
environment:
|
||||
- DB_HOST=mariadb
|
||||
- DB_USERNAME=my_user
|
||||
|
||||
Reference in New Issue
Block a user