Skip to content

Commit 6d67f34

Browse files
Updating Docker configuration, missing entrypoint to manage vendors (#15)
Co-authored-by: david <[email protected]>
1 parent 6bcb755 commit 6d67f34

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ RUN set -eux; \
2525
COPY src src/
2626
COPY tests tests/
2727

28+
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint
29+
RUN chmod +x /usr/local/bin/docker-entrypoint
30+
31+
ENTRYPOINT ["docker-entrypoint"]
2832
CMD ["php-fpm"]

docker-entrypoint.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/sh
2+
set -e
3+
4+
# first arg is `-f` or `--some-option`
5+
if [ "${1#-}" != "$1" ]; then
6+
set -- php-fpm "$@"
7+
fi
8+
9+
if [ "$1" = 'php-fpm' ] || [ "$1" = 'php' ] || [ "$1" = 'bin/console' ]; then
10+
mkdir -p var/cache var/log
11+
setfacl -R -m u:www-data:rwX -m u:"$(whoami)":rwX var
12+
setfacl -dR -m u:www-data:rwX -m u:"$(whoami)":rwX var
13+
14+
if [ "$APP_ENV" != 'prod' ]; then
15+
composer install --prefer-dist --no-progress --no-suggest --no-interaction
16+
fi
17+
fi
18+
19+
exec docker-php-entrypoint "$@"

0 commit comments

Comments
 (0)