mirror of
https://github.com/casjaysdevdocker/php
synced 2024-11-21 05:23:07 -05:00
🗃️ Committing everything that changed 🗃️
Dockerfile Dockerfile.7 Dockerfile.8 rootfs/root/docker/setup/02-packages.sh rootfs/root/docker/setup/03-files.sh rootfs/root/docker/setup/05-custom.sh rootfs/usr/local/bin/entrypoint.sh rootfs/usr/local/etc/docker/functions/entrypoint.sh
This commit is contained in:
parent
838729d4c3
commit
83b78ec6ca
@ -10,6 +10,7 @@ ARG DEFAULT_FILE_DIR="/usr/local/share/template-files"
|
|||||||
ARG DEFAULT_DATA_DIR="/usr/local/share/template-files/data"
|
ARG DEFAULT_DATA_DIR="/usr/local/share/template-files/data"
|
||||||
ARG DEFAULT_CONF_DIR="/usr/local/share/template-files/config"
|
ARG DEFAULT_CONF_DIR="/usr/local/share/template-files/config"
|
||||||
ARG DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults"
|
ARG DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults"
|
||||||
|
ARG PATH="/usr/local/etc/docker/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
|
|
||||||
ARG USER="root"
|
ARG USER="root"
|
||||||
ARG SHELL_OPTS="set -e -o pipefail"
|
ARG SHELL_OPTS="set -e -o pipefail"
|
||||||
@ -31,6 +32,7 @@ ARG BUILD_VERSION="${BUILD_DATE}"
|
|||||||
FROM tianon/gosu:latest AS gosu
|
FROM tianon/gosu:latest AS gosu
|
||||||
FROM ${PULL_URL}:${DISTRO_VERSION} AS build
|
FROM ${PULL_URL}:${DISTRO_VERSION} AS build
|
||||||
ARG TZ
|
ARG TZ
|
||||||
|
ARG PATH
|
||||||
ARG USER
|
ARG USER
|
||||||
ARG LICENSE
|
ARG LICENSE
|
||||||
ARG TIMEZONE
|
ARG TIMEZONE
|
||||||
@ -57,6 +59,7 @@ ARG PACK_LIST="bash-completion git curl wget sudo unzip iproute2 ssmtp openssl j
|
|||||||
|
|
||||||
ENV ENV=~/.profile
|
ENV ENV=~/.profile
|
||||||
ENV SHELL="/bin/sh"
|
ENV SHELL="/bin/sh"
|
||||||
|
ENV PATH="${PATH}"
|
||||||
ENV TZ="${TIMEZONE}"
|
ENV TZ="${TIMEZONE}"
|
||||||
ENV TIMEZONE="${TZ}"
|
ENV TIMEZONE="${TZ}"
|
||||||
ENV LANG="${LANGUAGE}"
|
ENV LANG="${LANGUAGE}"
|
||||||
@ -68,6 +71,10 @@ WORKDIR /root
|
|||||||
|
|
||||||
COPY ./rootfs/usr/local/bin/. /usr/local/bin/
|
COPY ./rootfs/usr/local/bin/. /usr/local/bin/
|
||||||
|
|
||||||
|
RUN set -e; \
|
||||||
|
echo "Updating the system"; \
|
||||||
|
pkmgr update
|
||||||
|
|
||||||
RUN set -e; \
|
RUN set -e; \
|
||||||
echo "Setting up prerequisites"; \
|
echo "Setting up prerequisites"; \
|
||||||
apk add --no-cache bash
|
apk add --no-cache bash
|
||||||
@ -178,6 +185,7 @@ RUN echo "Deleting unneeded files"; \
|
|||||||
RUN echo "Init done"
|
RUN echo "Init done"
|
||||||
FROM scratch
|
FROM scratch
|
||||||
ARG TZ
|
ARG TZ
|
||||||
|
ARG PATH
|
||||||
ARG USER
|
ARG USER
|
||||||
ARG TIMEZONE
|
ARG TIMEZONE
|
||||||
ARG LANGUAGE
|
ARG LANGUAGE
|
||||||
@ -223,6 +231,7 @@ LABEL com.github.containers.toolbox="false"
|
|||||||
|
|
||||||
ENV ENV=~/.bashrc
|
ENV ENV=~/.bashrc
|
||||||
ENV USER="${USER}"
|
ENV USER="${USER}"
|
||||||
|
ENV PATH="${PATH}"
|
||||||
ENV SHELL="/bin/bash"
|
ENV SHELL="/bin/bash"
|
||||||
ENV TZ="${TIMEZONE}"
|
ENV TZ="${TIMEZONE}"
|
||||||
ENV TIMEZONE="${TZ}"
|
ENV TIMEZONE="${TZ}"
|
||||||
|
@ -10,6 +10,7 @@ ARG DEFAULT_FILE_DIR="/usr/local/share/template-files"
|
|||||||
ARG DEFAULT_DATA_DIR="/usr/local/share/template-files/data"
|
ARG DEFAULT_DATA_DIR="/usr/local/share/template-files/data"
|
||||||
ARG DEFAULT_CONF_DIR="/usr/local/share/template-files/config"
|
ARG DEFAULT_CONF_DIR="/usr/local/share/template-files/config"
|
||||||
ARG DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults"
|
ARG DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults"
|
||||||
|
ARG PATH="/usr/local/etc/docker/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
|
|
||||||
ARG USER="root"
|
ARG USER="root"
|
||||||
ARG SHELL_OPTS="set -e -o pipefail"
|
ARG SHELL_OPTS="set -e -o pipefail"
|
||||||
@ -31,6 +32,7 @@ ARG BUILD_VERSION="${BUILD_DATE}"
|
|||||||
FROM tianon/gosu:latest AS gosu
|
FROM tianon/gosu:latest AS gosu
|
||||||
FROM ${PULL_URL}:${DISTRO_VERSION} AS build
|
FROM ${PULL_URL}:${DISTRO_VERSION} AS build
|
||||||
ARG TZ
|
ARG TZ
|
||||||
|
ARG PATH
|
||||||
ARG USER
|
ARG USER
|
||||||
ARG LICENSE
|
ARG LICENSE
|
||||||
ARG TIMEZONE
|
ARG TIMEZONE
|
||||||
@ -57,6 +59,7 @@ ARG PACK_LIST="bash-completion git curl wget sudo unzip iproute2 ssmtp openssl j
|
|||||||
|
|
||||||
ENV ENV=~/.profile
|
ENV ENV=~/.profile
|
||||||
ENV SHELL="/bin/sh"
|
ENV SHELL="/bin/sh"
|
||||||
|
ENV PATH="${PATH}"
|
||||||
ENV TZ="${TIMEZONE}"
|
ENV TZ="${TIMEZONE}"
|
||||||
ENV TIMEZONE="${TZ}"
|
ENV TIMEZONE="${TZ}"
|
||||||
ENV LANG="${LANGUAGE}"
|
ENV LANG="${LANGUAGE}"
|
||||||
@ -68,6 +71,10 @@ WORKDIR /root
|
|||||||
|
|
||||||
COPY ./rootfs/usr/local/bin/. /usr/local/bin/
|
COPY ./rootfs/usr/local/bin/. /usr/local/bin/
|
||||||
|
|
||||||
|
RUN set -e; \
|
||||||
|
echo "Updating the system"; \
|
||||||
|
pkmgr update
|
||||||
|
|
||||||
RUN set -e; \
|
RUN set -e; \
|
||||||
echo "Setting up prerequisites"; \
|
echo "Setting up prerequisites"; \
|
||||||
apk add --no-cache bash
|
apk add --no-cache bash
|
||||||
@ -178,6 +185,7 @@ RUN echo "Deleting unneeded files"; \
|
|||||||
RUN echo "Init done"
|
RUN echo "Init done"
|
||||||
FROM scratch
|
FROM scratch
|
||||||
ARG TZ
|
ARG TZ
|
||||||
|
ARG PATH
|
||||||
ARG USER
|
ARG USER
|
||||||
ARG TIMEZONE
|
ARG TIMEZONE
|
||||||
ARG LANGUAGE
|
ARG LANGUAGE
|
||||||
@ -223,6 +231,7 @@ LABEL com.github.containers.toolbox="false"
|
|||||||
|
|
||||||
ENV ENV=~/.bashrc
|
ENV ENV=~/.bashrc
|
||||||
ENV USER="${USER}"
|
ENV USER="${USER}"
|
||||||
|
ENV PATH="${PATH}"
|
||||||
ENV SHELL="/bin/bash"
|
ENV SHELL="/bin/bash"
|
||||||
ENV TZ="${TIMEZONE}"
|
ENV TZ="${TIMEZONE}"
|
||||||
ENV TIMEZONE="${TZ}"
|
ENV TIMEZONE="${TZ}"
|
||||||
|
@ -10,6 +10,7 @@ ARG DEFAULT_FILE_DIR="/usr/local/share/template-files"
|
|||||||
ARG DEFAULT_DATA_DIR="/usr/local/share/template-files/data"
|
ARG DEFAULT_DATA_DIR="/usr/local/share/template-files/data"
|
||||||
ARG DEFAULT_CONF_DIR="/usr/local/share/template-files/config"
|
ARG DEFAULT_CONF_DIR="/usr/local/share/template-files/config"
|
||||||
ARG DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults"
|
ARG DEFAULT_TEMPLATE_DIR="/usr/local/share/template-files/defaults"
|
||||||
|
ARG PATH="/usr/local/etc/docker/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
|
|
||||||
ARG USER="root"
|
ARG USER="root"
|
||||||
ARG SHELL_OPTS="set -e -o pipefail"
|
ARG SHELL_OPTS="set -e -o pipefail"
|
||||||
@ -31,6 +32,7 @@ ARG BUILD_VERSION="${BUILD_DATE}"
|
|||||||
FROM tianon/gosu:latest AS gosu
|
FROM tianon/gosu:latest AS gosu
|
||||||
FROM ${PULL_URL}:${DISTRO_VERSION} AS build
|
FROM ${PULL_URL}:${DISTRO_VERSION} AS build
|
||||||
ARG TZ
|
ARG TZ
|
||||||
|
ARG PATH
|
||||||
ARG USER
|
ARG USER
|
||||||
ARG LICENSE
|
ARG LICENSE
|
||||||
ARG TIMEZONE
|
ARG TIMEZONE
|
||||||
@ -57,6 +59,7 @@ ARG PACK_LIST="bash-completion git curl wget sudo unzip iproute2 ssmtp openssl j
|
|||||||
|
|
||||||
ENV ENV=~/.profile
|
ENV ENV=~/.profile
|
||||||
ENV SHELL="/bin/sh"
|
ENV SHELL="/bin/sh"
|
||||||
|
ENV PATH="${PATH}"
|
||||||
ENV TZ="${TIMEZONE}"
|
ENV TZ="${TIMEZONE}"
|
||||||
ENV TIMEZONE="${TZ}"
|
ENV TIMEZONE="${TZ}"
|
||||||
ENV LANG="${LANGUAGE}"
|
ENV LANG="${LANGUAGE}"
|
||||||
@ -68,6 +71,10 @@ WORKDIR /root
|
|||||||
|
|
||||||
COPY ./rootfs/usr/local/bin/. /usr/local/bin/
|
COPY ./rootfs/usr/local/bin/. /usr/local/bin/
|
||||||
|
|
||||||
|
RUN set -e; \
|
||||||
|
echo "Updating the system"; \
|
||||||
|
pkmgr update
|
||||||
|
|
||||||
RUN set -e; \
|
RUN set -e; \
|
||||||
echo "Setting up prerequisites"; \
|
echo "Setting up prerequisites"; \
|
||||||
apk add --no-cache bash
|
apk add --no-cache bash
|
||||||
@ -178,6 +185,7 @@ RUN echo "Deleting unneeded files"; \
|
|||||||
RUN echo "Init done"
|
RUN echo "Init done"
|
||||||
FROM scratch
|
FROM scratch
|
||||||
ARG TZ
|
ARG TZ
|
||||||
|
ARG PATH
|
||||||
ARG USER
|
ARG USER
|
||||||
ARG TIMEZONE
|
ARG TIMEZONE
|
||||||
ARG LANGUAGE
|
ARG LANGUAGE
|
||||||
@ -222,6 +230,7 @@ LABEL org.opencontainers.image.documentation="https://github.com/casjaysdevdocke
|
|||||||
LABEL com.github.containers.toolbox="false"
|
LABEL com.github.containers.toolbox="false"
|
||||||
|
|
||||||
ENV ENV=~/.bashrc
|
ENV ENV=~/.bashrc
|
||||||
|
ENV PATH="${PATH}"
|
||||||
ENV USER="${USER}"
|
ENV USER="${USER}"
|
||||||
ENV SHELL="/bin/bash"
|
ENV SHELL="/bin/bash"
|
||||||
ENV TZ="${TIMEZONE}"
|
ENV TZ="${TIMEZONE}"
|
||||||
|
@ -24,9 +24,10 @@ set -o pipefail
|
|||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Set env variables
|
# Set env variables
|
||||||
exitCode=0
|
exitCode=0
|
||||||
|
[ ! -f "/usr/local/etc/php-fpm.conf.default" ] || rm -Rf "/usr/local/etc/php-fpm.conf.default"
|
||||||
|
[ ! -f "/usr/local/etc/php-fpm.d/www.conf.default" ] || rm -Rf "/usr/local/etc/php-fpm.d/www.conf.default"
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Predifined actions
|
# Predefined actions
|
||||||
|
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Main script
|
# Main script
|
||||||
|
@ -56,7 +56,7 @@ if [ -d "/tmp/etc" ]; then
|
|||||||
echo "Installing $config to /etc/$name"
|
echo "Installing $config to /etc/$name"
|
||||||
if [ -d "$config" ]; then
|
if [ -d "$config" ]; then
|
||||||
mkdir -p "/etc/$name"
|
mkdir -p "/etc/$name"
|
||||||
copy "$config/." "/etc/$name/"
|
copy "$config/." "/usr/local/etc/$name/"
|
||||||
mkdir -p "/usr/local/share/template-files/config/$name"
|
mkdir -p "/usr/local/share/template-files/config/$name"
|
||||||
copy "$config/." "/usr/local/share/template-files/config/$name/"
|
copy "$config/." "/usr/local/share/template-files/config/$name/"
|
||||||
else
|
else
|
||||||
|
@ -38,7 +38,7 @@ if [ -n "$EXT_INSTALLED" ]; then
|
|||||||
chmod +x "$BIN_DIR/install-php-extensions"
|
chmod +x "$BIN_DIR/install-php-extensions"
|
||||||
for ext in $EXT_LIST $EXT_ADDITIONAL; do
|
for ext in $EXT_LIST $EXT_ADDITIONAL; do
|
||||||
if ! echo "$ext" | grep -q "$EXT_INSTALLED"; then
|
if ! echo "$ext" | grep -q "$EXT_INSTALLED"; then
|
||||||
install-php-extensions $ext
|
apk add --no-cache php-$ext || install-php-extensions $ext
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
# @@Description : Entrypoint file for php
|
# @@Description : Entrypoint file for php
|
||||||
# @@Changelog : New script
|
# @@Changelog : New script
|
||||||
# @@TODO : Better documentation
|
# @@TODO : Better documentation
|
||||||
# @@Other :
|
# @@Other :
|
||||||
# @@Resource :
|
# @@Resource :
|
||||||
# @@Terminal App : no
|
# @@Terminal App : no
|
||||||
# @@sudo/root : no
|
# @@sudo/root : no
|
||||||
# @@Template : other/docker-entrypoint
|
# @@Template : other/docker-entrypoint
|
||||||
@ -24,7 +24,7 @@
|
|||||||
[ -f "/config/.debug" ] && [ -z "$DEBUGGER_OPTIONS" ] && export DEBUGGER_OPTIONS="$(<"/config/.debug")" || DEBUGGER_OPTIONS="${DEBUGGER_OPTIONS:-}"
|
[ -f "/config/.debug" ] && [ -z "$DEBUGGER_OPTIONS" ] && export DEBUGGER_OPTIONS="$(<"/config/.debug")" || DEBUGGER_OPTIONS="${DEBUGGER_OPTIONS:-}"
|
||||||
{ [ "$DEBUGGER" = "on" ] || [ -f "/config/.debug" ]; } && echo "Enabling debugging" && set -o pipefail -x$DEBUGGER_OPTIONS && export DEBUGGER="on" || set -o pipefail
|
{ [ "$DEBUGGER" = "on" ] || [ -f "/config/.debug" ]; } && echo "Enabling debugging" && set -o pipefail -x$DEBUGGER_OPTIONS && export DEBUGGER="on" || set -o pipefail
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
PATH="/usr/local/etc/docker/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin"
|
export PATH="/usr/local/etc/docker/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Set bash options
|
# Set bash options
|
||||||
SCRIPT_FILE="$0"
|
SCRIPT_FILE="$0"
|
||||||
|
@ -1058,7 +1058,9 @@ __initialize_ssl_certs() {
|
|||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
__start_php_dev_server() {
|
__start_php_dev_server() {
|
||||||
local web_root="${1:-$WWW_ROOT_DIR}"
|
local web_root="${1:-$WWW_ROOT_DIR}"
|
||||||
if [ -n "$PHP_DEV_SERVER_PORT" ] && [ "$2" = "yes" ]; then
|
local start_server="${2:-$PHP_DEV_SERVER_START}"
|
||||||
|
[ "$CONTAINER_NAME" = "php" ] && start_server="yes"
|
||||||
|
if [ -n "$PHP_DEV_SERVER_PORT" ] && [ "$start_server" = "yes" ]; then
|
||||||
if ! echo "$web_root" | grep -q "^/usr/share/httpd"; then
|
if ! echo "$web_root" | grep -q "^/usr/share/httpd"; then
|
||||||
find "$web_root" -type f -not -path '.git*' -iname '*.php' -exec sed -i 's|[<].*SERVER_ADDR.*[>]|'${CONTAINER_IP4_ADDRESS:-127.0.0.1}'|g' {} \; 2>/dev/null
|
find "$web_root" -type f -not -path '.git*' -iname '*.php' -exec sed -i 's|[<].*SERVER_ADDR.*[>]|'${CONTAINER_IP4_ADDRESS:-127.0.0.1}'|g' {} \; 2>/dev/null
|
||||||
php -S 0.0.0.0:$PHP_DEV_SERVER_PORT -t "$web_root"
|
php -S 0.0.0.0:$PHP_DEV_SERVER_PORT -t "$web_root"
|
||||||
@ -1153,6 +1155,7 @@ export LANG="${LANG:-C.UTF-8}"
|
|||||||
export LC_ALL="${LANG:-C.UTF-8}"
|
export LC_ALL="${LANG:-C.UTF-8}"
|
||||||
export TZ="${TZ:-${TIMEZONE:-America/New_York}}"
|
export TZ="${TZ:-${TIMEZONE:-America/New_York}}"
|
||||||
export HOSTNAME="${FULL_DOMAIN_NAME:-${SERVER_HOSTNAME:-$HOSTNAME}}"
|
export HOSTNAME="${FULL_DOMAIN_NAME:-${SERVER_HOSTNAME:-$HOSTNAME}}"
|
||||||
|
export PATH="/usr/local/etc/docker/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||||
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||||
# Default directories
|
# Default directories
|
||||||
export SSL_DIR="${SSL_DIR:-/config/ssl}"
|
export SSL_DIR="${SSL_DIR:-/config/ssl}"
|
||||||
|
Loading…
Reference in New Issue
Block a user