Версия 0.5.0 #8
@@ -19,7 +19,7 @@ COPY --from=unit_builder /var/lib/unit/ /var/lib/unit/
|
||||
|
||||
COPY docker/unit-config.json /docker-entrypoint.d/config.json
|
||||
|
||||
RUN apk --no-cache add pcre2 libbz2 libpng libwebp libjpeg-turbo icu-libs freetype oniguruma libzip \
|
||||
RUN apk --no-cache add pcre2 libbz2 libpng libwebp libjpeg-turbo icu-libs freetype oniguruma libzip jq \
|
||||
&& apk add --no-cache --virtual .phpize-deps icu-dev libpng-dev bzip2-dev libwebp-dev libjpeg-turbo-dev freetype-dev oniguruma-dev libzip-dev pcre2-dev ${PHPIZE_DEPS} \
|
||||
&& docker-php-ext-configure intl --enable-intl && \
|
||||
docker-php-ext-configure bcmath --enable-bcmath && \
|
||||
|
@@ -42,6 +42,20 @@ if [ "$role" = "app" ]; then
|
||||
if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -print -quit 2>/dev/null | /bin/grep -q .; then
|
||||
echo "$0: /docker-entrypoint.d/ is not empty, applying initial configuration..."
|
||||
|
||||
if [[ -n "${UNIT_SOURCE:-}" ]]; then
|
||||
config="/docker-entrypoint.d/config.json"
|
||||
tmp="$(mktemp)"
|
||||
jq --arg src "${UNIT_SOURCE}" '
|
||||
.listeners["*:9000"].forwarded.source =
|
||||
( $src
|
||||
| split(",")
|
||||
| map( gsub("^\\s+|\\s+$"; "") ) # trim пробелы
|
||||
| map( select(. != "") ) # убрать пустые
|
||||
)
|
||||
' "$config" > "$tmp"
|
||||
mv "$tmp" "$config"
|
||||
fi
|
||||
|
||||
echo "$0: Looking for certificate bundles in /docker-entrypoint.d/..."
|
||||
for f in $(/usr/bin/find /docker-entrypoint.d/ -type f -name "*.pem"); do
|
||||
echo "$0: Uploading certificates bundle: $f"
|
||||
@@ -60,12 +74,6 @@ if [ "$role" = "app" ]; then
|
||||
curl_put $f "config"
|
||||
done
|
||||
|
||||
if [ ! -z ${UNIT_SOURCE+x} ]
|
||||
then
|
||||
echo $UNIT_SOURCE > /docker-entrypoint.d/unit_source.json
|
||||
curl_put "/docker-entrypoint.d/unit_source.json" "config/listeners/*:9000/forwarded/source"
|
||||
fi
|
||||
|
||||
echo "$0: Looking for shell scripts in /docker-entrypoint.d/..."
|
||||
for f in $(/usr/bin/find /docker-entrypoint.d/ -type f -name "*.sh"); do
|
||||
echo "$0: Launching $f";
|
||||
|
@@ -42,6 +42,20 @@ if [ "$role" = "app" ]; then
|
||||
if /usr/bin/find "/docker-entrypoint.d/" -mindepth 1 -print -quit 2>/dev/null | /bin/grep -q .; then
|
||||
echo "$0: /docker-entrypoint.d/ is not empty, applying initial configuration..."
|
||||
|
||||
if [[ -n "${UNIT_SOURCE:-}" ]]; then
|
||||
config="/docker-entrypoint.d/config.json"
|
||||
tmp="$(mktemp)"
|
||||
jq --arg src "${UNIT_SOURCE}" '
|
||||
.listeners["*:9000"].forwarded.source =
|
||||
( $src
|
||||
| split(",")
|
||||
| map( gsub("^\\s+|\\s+$"; "") ) # trim пробелы
|
||||
| map( select(. != "") ) # убрать пустые
|
||||
)
|
||||
' "$config" > "$tmp"
|
||||
mv "$tmp" "$config"
|
||||
fi
|
||||
|
||||
echo "$0: Looking for certificate bundles in /docker-entrypoint.d/..."
|
||||
for f in $(/usr/bin/find /docker-entrypoint.d/ -type f -name "*.pem"); do
|
||||
echo "$0: Uploading certificates bundle: $f"
|
||||
@@ -60,12 +74,6 @@ if [ "$role" = "app" ]; then
|
||||
curl_put $f "config"
|
||||
done
|
||||
|
||||
if [ ! -z ${UNIT_SOURCE+x} ]
|
||||
then
|
||||
echo $UNIT_SOURCE > /docker-entrypoint.d/unit_source.json
|
||||
curl_put "/docker-entrypoint.d/unit_source.json" "config/listeners/*:9000/forwarded/source"
|
||||
fi
|
||||
|
||||
echo "$0: Looking for shell scripts in /docker-entrypoint.d/..."
|
||||
for f in $(/usr/bin/find /docker-entrypoint.d/ -type f -name "*.sh"); do
|
||||
echo "$0: Launching $f";
|
||||
|
@@ -16,7 +16,7 @@ services:
|
||||
- ./app/application:/var/www/html
|
||||
environment:
|
||||
CONTAINER_ROLE: app
|
||||
UNIT_SOURCE: '"172.16.0.0/12"'
|
||||
UNIT_SOURCE: "172.16.0.0/12"
|
||||
|
||||
queue:
|
||||
build:
|
||||
|
@@ -13,7 +13,7 @@ services:
|
||||
env_file: app/.env
|
||||
environment:
|
||||
CONTAINER_ROLE: app
|
||||
UNIT_SOURCE: '"172.16.0.0/12"'
|
||||
UNIT_SOURCE: "172.16.0.0/12"
|
||||
volumes:
|
||||
- ./app/storage/app:/var/www/html/storage/app
|
||||
- ./app/storage/logs:/var/www/html/storage/logs
|
||||
|
@@ -1,4 +1,4 @@
|
||||
version: '3.7'
|
||||
#version: '3.7'
|
||||
services:
|
||||
app:
|
||||
build:
|
||||
@@ -13,6 +13,8 @@ services:
|
||||
- ${DOCKER_APP_PORT}:9000
|
||||
volumes:
|
||||
- ./app/application:/var/www/html
|
||||
environment:
|
||||
CONTAINER_ROLE: app
|
||||
|
||||
queue:
|
||||
build:
|
||||
|
Reference in New Issue
Block a user