Skip to content

Commit e88f5c5

Browse files
committed
Merge branch 'hotfix/security-checker'
Signed-off-by: Aleksandr Beshkenadze <ab@caesar.team>
2 parents 5d678d5 + f816bf0 commit e88f5c5

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,27 @@ RUN bash init_db.sh postgres & wait-for-it.sh 127.0.0.1:5432 -- echo "postgres i
7676
FROM node:10-alpine AS yarn-enc
7777
COPY . .
7878
RUN yarn install && yarn encore production
79+
80+
## ---- security-checker ----
81+
FROM base AS security-checker
82+
## install vendors
83+
RUN apk add --no-cache git make musl-dev go
84+
# Configure Go
85+
ENV GOROOT /usr/lib/go
86+
ENV GOPATH /usr/src/go
87+
ENV PATH /usr/src/go/bin:$PATH
88+
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin /usr/src/go /usr/src/security-checker
89+
RUN curl -Lo /usr/src/security-checker.tar.gz https://github.com/fabpot/local-php-security-checker/archive/v1.0.0.tar.gz
90+
RUN tar -xvzf /usr/src/security-checker.tar.gz -C /usr/src/
91+
RUN cd /usr/src/local-php-security-checker-1.0.0 && go build
92+
RUN chmod +x /usr/src/local-php-security-checker-1.0.0/local-php-security-checker && cp /usr/src/local-php-security-checker-1.0.0/local-php-security-checker /usr/local/bin/
93+
94+
7995
## ---- Dependencies ----
8096
FROM base AS dependencies
8197
## install vendors
8298
USER www-data
99+
COPY --chown=www-data:www-data --from=security-checker /usr/local/bin/local-php-security-checker /usr/local/bin/local-php-security-checker
83100
RUN APP_ENV=prod composer install --prefer-dist --no-plugins --no-scripts --no-dev --optimize-autoloader
84101
#
85102
## ---- Release ----

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"auto-scripts": {
100100
"cache:clear": "symfony-cmd",
101101
"assets:install %PUBLIC_DIR%": "symfony-cmd",
102-
"security:check": "symfony-cmd"
102+
"local-php-security-checker --path=/var/www/html/composer.lock --format=ansi": "script"
103103
},
104104
"post-install-cmd": [
105105
"@auto-scripts"

0 commit comments

Comments
 (0)