Skip to content

Commit 967f3f2

Browse files
committed
Missing install for prod mode
1 parent eaf5639 commit 967f3f2

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ COPY . .
9595

9696
RUN set -eux; \
9797
mkdir -p var/cache var/log; \
98+
composer install --no-progress --no-suggest --no-interaction --no-dev --no-scripts; \
9899
composer dump-autoload --classmap-authoritative --no-dev; \
99100
composer run-script --no-dev post-install-cmd; sync
100101
VOLUME /srv/app/var
@@ -124,7 +125,10 @@ COPY --from=symfony_php /srv/app/public public/
124125
# "h2-proxy-cert" stage
125126
FROM alpine:latest AS symfony_h2-proxy-cert
126127

127-
RUN apk add --no-cache openssl
128+
RUN apk add --no-cache \
129+
ca-certificates \
130+
openssl \
131+
;
128132

129133
# Allow to set server name
130134
ARG SERVER_NAME="localhost"
@@ -151,7 +155,8 @@ RUN set -eux; \
151155
# create the signed certificate
152156
RUN openssl x509 -req -sha256 -extensions v3_ca -extfile extfile.cnf -days 365 \
153157
-in server.csr -signkey server.key -out server.crt \
154-
&& rm extfile.cnf
158+
&& rm extfile.cnf \
159+
&& update-ca-certificates
155160

156161
### "h2-proxy" stage
157162
FROM nginx:${NGINX_VERSION}-alpine AS symfony_h2-proxy

docker/php/docker-entrypoint.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,20 @@ if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
1313
fi
1414
ln -sf "$PHP_INI_RECOMMENDED" "$PHP_INI_DIR/php.ini"
1515

16-
mkdir -p var/cache var/log
16+
mkdir -p var/cache var/log
1717

18-
# The first time volumes are mounted, the project needs to be recreated
19-
if [ ! -f composer.json ]; then
20-
composer create-project "symfony/skeleton $SYMFONY_VERSION" tmp --stability=$STABILITY --prefer-dist --no-progress --no-interaction
21-
jq '.extra.symfony.docker=true' tmp/composer.json > tmp/composer.tmp.json
22-
rm tmp/composer.json
23-
mv tmp/composer.tmp.json tmp/composer.json
18+
# The first time volumes are mounted, the project needs to be recreated
19+
if [ ! -f composer.json ]; then
20+
composer create-project "symfony/skeleton $SYMFONY_VERSION" tmp --stability=$STABILITY --prefer-dist --no-progress --no-interaction
21+
jq '.extra.symfony.docker=true' tmp/composer.json > tmp/composer.tmp.json
22+
rm tmp/composer.json
23+
mv tmp/composer.tmp.json tmp/composer.json
2424

25-
cp -Rp tmp/. .
26-
rm -Rf tmp/
27-
elif [ "$APP_ENV" != 'prod' ]; then
28-
composer install --prefer-dist --no-progress --no-suggest --no-interaction
29-
fi
25+
cp -Rp tmp/. .
26+
rm -Rf tmp/
27+
elif [ "$APP_ENV" != 'prod' ]; then
28+
composer install --prefer-dist --no-progress --no-suggest --no-interaction
29+
fi
3030

3131
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var
3232
setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var

0 commit comments

Comments
 (0)