-
Notifications
You must be signed in to change notification settings - Fork 19
/
Dockerfile
45 lines (29 loc) · 1.36 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
FROM php:8.2-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/psalm/psalm-github-security-scan"
LABEL "homepage"="http://github.com/actions"
LABEL "maintainer"="Matt Brown <github@muglug.com>"
# Code borrowed from mickaelandrieu/psalm-ga which in turn borrowed from phpqa/psalm
# Install Tini - https://github.com/krallin/tini
RUN apk add --no-cache tini git
COPY --from=composer:2.6.5 /usr/bin/composer /usr/bin/composer
RUN COMPOSER_ALLOW_SUPERUSER=1 \
COMPOSER_HOME="/composer" \
composer global config minimum-stability dev
# 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"]