Missing install for prod mode
This commit is contained in:
parent
eaf5639e41
commit
967f3f270a
@ -95,6 +95,7 @@ COPY . .
|
|||||||
|
|
||||||
RUN set -eux; \
|
RUN set -eux; \
|
||||||
mkdir -p var/cache var/log; \
|
mkdir -p var/cache var/log; \
|
||||||
|
composer install --no-progress --no-suggest --no-interaction --no-dev --no-scripts; \
|
||||||
composer dump-autoload --classmap-authoritative --no-dev; \
|
composer dump-autoload --classmap-authoritative --no-dev; \
|
||||||
composer run-script --no-dev post-install-cmd; sync
|
composer run-script --no-dev post-install-cmd; sync
|
||||||
VOLUME /srv/app/var
|
VOLUME /srv/app/var
|
||||||
@ -124,7 +125,10 @@ COPY --from=symfony_php /srv/app/public public/
|
|||||||
# "h2-proxy-cert" stage
|
# "h2-proxy-cert" stage
|
||||||
FROM alpine:latest AS symfony_h2-proxy-cert
|
FROM alpine:latest AS symfony_h2-proxy-cert
|
||||||
|
|
||||||
RUN apk add --no-cache openssl
|
RUN apk add --no-cache \
|
||||||
|
ca-certificates \
|
||||||
|
openssl \
|
||||||
|
;
|
||||||
|
|
||||||
# Allow to set server name
|
# Allow to set server name
|
||||||
ARG SERVER_NAME="localhost"
|
ARG SERVER_NAME="localhost"
|
||||||
@ -151,7 +155,8 @@ RUN set -eux; \
|
|||||||
# create the signed certificate
|
# create the signed certificate
|
||||||
RUN openssl x509 -req -sha256 -extensions v3_ca -extfile extfile.cnf -days 365 \
|
RUN openssl x509 -req -sha256 -extensions v3_ca -extfile extfile.cnf -days 365 \
|
||||||
-in server.csr -signkey server.key -out server.crt \
|
-in server.csr -signkey server.key -out server.crt \
|
||||||
&& rm extfile.cnf
|
&& rm extfile.cnf \
|
||||||
|
&& update-ca-certificates
|
||||||
|
|
||||||
### "h2-proxy" stage
|
### "h2-proxy" stage
|
||||||
FROM nginx:${NGINX_VERSION}-alpine AS symfony_h2-proxy
|
FROM nginx:${NGINX_VERSION}-alpine AS symfony_h2-proxy
|
||||||
|
@ -13,20 +13,20 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
|
|||||||
fi
|
fi
|
||||||
ln -sf "$PHP_INI_RECOMMENDED" "$PHP_INI_DIR/php.ini"
|
ln -sf "$PHP_INI_RECOMMENDED" "$PHP_INI_DIR/php.ini"
|
||||||
|
|
||||||
mkdir -p var/cache var/log
|
mkdir -p var/cache var/log
|
||||||
|
|
||||||
# The first time volumes are mounted, the project needs to be recreated
|
# The first time volumes are mounted, the project needs to be recreated
|
||||||
if [ ! -f composer.json ]; then
|
if [ ! -f composer.json ]; then
|
||||||
composer create-project "symfony/skeleton $SYMFONY_VERSION" tmp --stability=$STABILITY --prefer-dist --no-progress --no-interaction
|
composer create-project "symfony/skeleton $SYMFONY_VERSION" tmp --stability=$STABILITY --prefer-dist --no-progress --no-interaction
|
||||||
jq '.extra.symfony.docker=true' tmp/composer.json > tmp/composer.tmp.json
|
jq '.extra.symfony.docker=true' tmp/composer.json > tmp/composer.tmp.json
|
||||||
rm tmp/composer.json
|
rm tmp/composer.json
|
||||||
mv tmp/composer.tmp.json tmp/composer.json
|
mv tmp/composer.tmp.json tmp/composer.json
|
||||||
|
|
||||||
cp -Rp tmp/. .
|
cp -Rp tmp/. .
|
||||||
rm -Rf tmp/
|
rm -Rf tmp/
|
||||||
elif [ "$APP_ENV" != 'prod' ]; then
|
elif [ "$APP_ENV" != 'prod' ]; then
|
||||||
composer install --prefer-dist --no-progress --no-suggest --no-interaction
|
composer install --prefer-dist --no-progress --no-suggest --no-interaction
|
||||||
fi
|
fi
|
||||||
|
|
||||||
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var
|
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var
|
||||||
setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var
|
setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var
|
||||||
|
Loading…
x
Reference in New Issue
Block a user