Skip to content

Commit 16ada13

Browse files
committed
Use composer audit
1 parent fc371e6 commit 16ada13

File tree

3 files changed

+13
-24
lines changed

3 files changed

+13
-24
lines changed

Dockerfile

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,12 @@ RUN chmod +x /app/bin/console
4646
RUN chmod +x /app/docker-entrypoint.sh
4747
RUN chmod +x /usr/bin/composer
4848

49-
RUN curl -s https://api.github.com/repos/fabpot/local-php-security-checker/releases/latest | \
50-
grep -E "browser_download_url(.+)linux_amd64" | \
51-
cut -d : -f 2,3 | \
52-
tr -d \" | \
53-
xargs -I{} wget -O local-php-security-checker {} \
54-
&& mv local-php-security-checker /usr/bin/local-php-security-checker \
55-
&& chmod +x /usr/bin/local-php-security-checker
56-
5749
RUN rm -rf /app/var \
5850
&& mkdir -p /app/var \
5951
&& rm -rf /app/docker \
6052
&& rm -rf /app/public/check.php \
61-
&& php -d memory_limit=-1 /usr/bin/composer install --no-dev --optimize-autoloader
53+
&& php -d memory_limit=-1 /usr/bin/composer install --no-dev --optimize-autoloader \
54+
&& php /usr/bin/composer audit
6255

6356
EXPOSE 9000
6457

Dockerfile_dev

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -85,14 +85,6 @@ COPY ./docker/php/www-dev.conf /usr/local/etc/php-fpm.d/www.conf
8585

8686
RUN chmod -R o+s+w /usr/local/etc/php
8787

88-
RUN curl -s https://api.github.com/repos/fabpot/local-php-security-checker/releases/latest | \
89-
grep -E "browser_download_url(.+)linux_amd64" | \
90-
cut -d : -f 2,3 | \
91-
tr -d \" | \
92-
xargs -I{} wget -O local-php-security-checker {} \
93-
&& mv local-php-security-checker /usr/bin/local-php-security-checker \
94-
&& chmod +x /usr/bin/local-php-security-checker
95-
9688
RUN groupadd --gid ${HOST_GID} dev \
9789
&& useradd \
9890
-p $(perl -e 'print crypt($ARGV[0], "password")' 'dev') \

docker-entrypoint-dev.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,11 @@ set -e
66
# 0) Basic linting of current JSON configuration file
77
# 1) Export needed environment variables
88
# 2) Install all dependencies
9-
# 3) Generate JWT encryption keys
10-
# 4) Create database if it not exists yet
11-
# 5) Run possible migrations, so that database is always up to date
12-
# 6) Add needed symfony console autocomplete for bash
9+
# 3) Check if there are any security issues in dependencies
10+
# 4) Generate JWT encryption keys
11+
# 5) Create database if it not exists yet
12+
# 6) Run possible migrations, so that database is always up to date
13+
# 7) Add needed symfony console autocomplete for bash
1314
#
1415

1516
# Step 0
@@ -25,15 +26,18 @@ export XDEBUG_SESSION=PHPSTORM
2526
COMPOSER_MEMORY_LIMIT=-1 composer install --optimize-autoloader
2627

2728
# Step 3
28-
make generate-jwt-keys
29+
composer audit
2930

3031
# Step 4
31-
./bin/console doctrine:database:create --no-interaction --if-not-exists
32+
make generate-jwt-keys
3233

3334
# Step 5
34-
./bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration --all-or-nothing
35+
./bin/console doctrine:database:create --no-interaction --if-not-exists
3536

3637
# Step 6
38+
./bin/console doctrine:migrations:migrate --no-interaction --allow-no-migration --all-or-nothing
39+
40+
# Step 7
3741
./bin/console completion bash >> /home/dev/.bashrc
3842

3943
exec "$@"

0 commit comments

Comments
 (0)