forked from psalm/psalm-github-security-scan
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (33 loc) · 1.64 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM php:8.3-alpine
LABEL "com.github.actions.name"="Psalm"
LABEL "com.github.actions.description"="A static analysis tool for finding errors in PHP applications"
LABEL "com.github.actions.icon"="check"
LABEL "com.github.actions.color"="blue"
LABEL "repository"="http://github.com/mbinorg/psalm-github-security-scan"
LABEL "homepage"="http://github.com/actions"
LABEL "maintainer"="Melroy van den Berg <[email protected]>"
# Code borrowed from psalm/psalm-github-security-scan
# Install Tini - https://github.com/krallin/tini
RUN apk add --no-cache tini git
COPY --from=composer:2.7.8 /usr/bin/composer /usr/bin/composer
RUN COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME="/composer" \
composer global config minimum-stability dev
# Install php extensions, by docker-php-extension-installer
# Required for some composer packages to be pre-installed
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions amqp gd curl simplexml dom xml redis intl opcache apcu pcntl bcmath xsl
# This line invalidates cache when master branch change
ADD https://github.com/vimeo/psalm/commits/master.atom /dev/null
RUN COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME="/composer" \
composer global require vimeo/psalm --prefer-dist --no-progress --dev
ENV PATH /composer/vendor/bin:${PATH}
# Satisfy Psalm's quest for a composer autoloader (with a symlink that disappears once a volume is mounted at /app)
RUN mkdir /app && ln -s /composer/vendor/ /app/vendor
# Add entrypoint script
COPY ./entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Package container
WORKDIR "/app"
ENTRYPOINT ["/entrypoint.sh"]