-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
38 lines (31 loc) · 1.17 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
FROM alpine:3.19
LABEL maintainer="[email protected]"
RUN \
# Install dependencies
apk add --no-cache composer php82 php82-ctype php82-dom php82-fileinfo \
php82-gd php82-json php82-mbstring php82-opcache php82-pdo_sqlite \
php82-tokenizer php82-xml php82-xmlwriter nodejs npm mailcap \
# Install npm modules
&& npm install -g mocha jsverify jsdom@9 jsdom-global@2 mime-types \
@peculiar/webcrypto jsdom-url fake-indexeddb \
&& wget -qO- https://gobinaries.com/tj/node-prune | sh \
&& cd /usr/local \
&& node-prune lib/node_modules \
# Install composer modules
&& composer require phpunit/phpunit:^9 google/cloud-storage:1.41.0 \
# cleanup to reduce the already large image size
&& apk del --no-cache composer npm \
&& rm -rf /bin/.cache \
/etc/mailcap \
/root/.??* \
/tmp/* \
/usr/lib/node_modules/npm \
/usr/local/bin/node-prune \
/usr/local/composer.* \
/var/log/*
# mark dirs as volumes that need to be writable, allows running the container --read-only
VOLUME /srv /tmp
COPY unit-test.sh /usr/local/bin/
WORKDIR /usr/local/bin
USER nobody
ENTRYPOINT ["unit-test.sh"]